[albatross-users] pickle problem

Andrew McNamara andrewm at object-craft.com.au
Mon May 2 13:10:10 EST 2005


>You might do better asking on python-list at python.org - this error is
>coming out of cPickle, rather than Albatross (albatross has simply caught
>the error and re-raised it to add more diagnostics).
>
>If I had to guess, I would say that the pickler is unable to identify
>the code object associated with that class. When you pickle an instance
>of a class, only the instance attributes and a reference (the module
>and class name) to the class are saved.

Looking at the pickle source code, this error is raised when the object
can't be found by name in sys.modules. In other words (and simplified
slightly):

    obj != getattr(sys.modules[obj.__module__], obj.__name__)

So, I guess that means either:

 * the object lies about it's name or module,
 * the object has been obscured by a later binding with the same name, or,
 * the module has been obscured by something playing tricks with sys.modules.

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/



More information about the Albatross-users mailing list