Opened 10 years ago

Last modified 7 years ago

#10865 closed

Unable to pickle Queryset — at Initial Version

Reported by: wfagan@… Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I am getting an error while trying this code. I am using memcached as my backend. It looks like it isn't able to correctly pickle the queryset. This article makes me think it should be able to pickle them...

places = Place.objects.all()
cache.set("places", pickle.dumps(places))
c = cache.get("places")

Traceback (most recent call last):

File "<console>", line 1, in <module>
File "/usr/lib/python2.6/", line 1374, in loads

return Unpickler(file).load()

File "/usr/lib/python2.6/", line 858, in load


File "/usr/lib/python2.6/", line 1090, in load_global

klass = self.find_class(module, name)

File "/usr/lib/python2.6/", line 1124, in find_class


TypeError: import() argument 1 must be string without null bytes, not str

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top