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 ticket
http://code.djangoproject.com/ticket/10865 and he 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
-~----------~----~----~----~------~----~------~--~---