Skip to content Skip to sidebar Skip to footer

Django Mod_wsgi Picklingerror While Saving Object

Do you know any solution to this: [Thu Jul 08 19:15:38 2010] [error] [client 79.162.31.162] mod_wsgi (pid=3072): Exception occurred processing WSGI script '/home/www/shop/django.ws

Solution 1:

See this answer. Does that help?

EDIT (responding to your comment):

I'm afraid I don't know either django or your code well enough to give you a fix. I do have a clearer idea of the underlying error, though: Before this error occurred, an instance of decimal.Decimal was created, and then for some reason the class decimal.Decimal was re-defined. The pickle class doesn't work when it can't locate, by name, the class definition for a given object.

Here's an interpreter session showing a similar problem:

>>>import cPickle>>>classFoo(object):...pass...>>>f = Foo()>>>s = cPickle.dumps(f)>>>>>># Redefine class Foo >>>classFoo(object):...pass...>>># Now attempt to pickle the same object that was created with the old Foo class>>>s = cPickle.dumps(f)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cPickle.PicklingError: Can't pickle <class '__main__.Foo'>: it's not the same object as __main__.Foo
>>>>>># Create an object with the new Foo class, and try to pickle it (this works)>>>f2 = Foo()>>>s = cPickle.dumps(f2)

Post a Comment for "Django Mod_wsgi Picklingerror While Saving Object"