Thanks for replying Anatolly,

I'm 0-2 on it crashing on other peoples machines.

I have it doing the identical thing on 2 machines, one of which is
using python 2.5 and django svn. The other is using python 2.6 and
django svn. Both are using the 1.2 series of memcached and I have
tried using both python-memcache and cmemcache for the bindings. The
two machines I am having problems on are Ubuntu 9.04 and whatever
webfaction is running on.

After installing cmemcache I end up with an error while running
test.py file...

======================================================================
FAIL: test_memcache (__main__.TestCmemcache)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test.py", line 254, in test_memcache
    self._test_base(cmemcache, cmemcache.StringClient(self.servers),
ok=1)
  File "test.py", line 132, in _test_base
    self.failUnlessEqual(len(stats), 1)
AssertionError: 0 != 1

----------------------------------------------------------------------
Ran 1 test in 0.556s

FAILED (failures=1)



which someone else seemed to run into on this post
http://ubuntuforums.org/archive/index.php/t-1044135.html

Even with the test failing I was able to drop into the shell and test
both cmemcache and python-memcach manually and they seemed to be
operating correctly. Plus if instead of caching the querysets I cache
the list version all is well.

So I'm stumped at the cause.

Thanks for taking a look.

Will

On Apr 20, 12:31 pm, Anatoliy <[email protected]> wrote:
> Works for me.
>
> What version of python, django, memcached and python memcache bindings
> you use?
>
> On 20 апр, 11:41, libwilliam <[email protected]> wrote:
>
> >http://dl.getdropbox.com/u/174510/pickle_test.tar.gz
>
> > I am having trouble pickling querysets. I don't have any problem when
> > using local memory but I do when using memcached. I have a link to a
> > test project that shows the problem. The settings file is using
> > memcached on port 2559. I started memcached using this command.
>
> > memcached -d -m 200 -l 127.0.0.1 -p 2559
>
> > then ran the test framework...
>
> > python manage.py test main
>
> > ======================================================================
> > FAIL: Doctest: main.models.Place
> > ----------------------------------------------------------------------
> > Traceback (most recent call last):
> >   File "/usr/local/lib/python2.6/dist-packages/django/test/
> > _doctest.py", line 2180, in runTest
> >     raise self.failureException(self.format_failure(new.getvalue()))
> > AssertionError: Failed doctest test for main.models.Place
> >   File "/home/will/Projects/pickle_test/main/models.py", line 5, in
> > Place
>
> > ----------------------------------------------------------------------
> > File "/home/will/Projects/pickle_test/main/models.py", line 16, in
> > main.models.Place
> > Failed example:
> >     loads(cache.get("places")).count() == 1
> > Exception raised:
> >     Traceback (most recent call last):
> >       File "/usr/local/lib/python2.6/dist-packages/django/test/
> > _doctest.py", line 1267, in __run
> >         compileflags, 1) in test.globs
> >       File "<doctest main.models.Place[7]>", line 1, in <module>
> >         loads(cache.get("places")).count() == 1
> >       File "/usr/lib/python2.6/pickle.py", line 1374, in loads
> >         return Unpickler(file).load()
> >       File "/usr/lib/python2.6/pickle.py", line 858, in load
> >         dispatch[key](self)
> >       File "/usr/lib/python2.6/pickle.py", line 1090, in load_global
> >         klass = self.find_class(module, name)
> >       File "/usr/lib/python2.6/pickle.py", line 1124, in find_class
> >         __import__(module)
> >     TypeError: __import__() argument 1 must be string without null
> > bytes, not str
>
> > It looks to me that the pickling code is creating a string with null
> > bytes, which memcached has a problem with but seems to work when using
> > CACHE_BACKEND = 'locmem:///'
>
> > I think that but I had a guy try it out on a 
> > tickethttp://code.djangoproject.com/ticket/10865andhe didn't have the
> > problem. So I was wondering if anyone had an idea of what I am doing
> > wrong because I can't seem to figure it out.
>
> > Thank You, Will
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to