cPickle vs pickle discrepancy

Zac Burns zac256 at gmail.com
Mon Jan 5 20:04:30 EST 2009


Greetings,

I have a module that attempts to pickle classes defined in that module.

I get an error of the form:
PicklingError: Can't pickle <class 'Module.SubModule.Class'>: import
of module Module.SubModule failed
when using cPickle (protocol -1, python version 2.5.1).

The module has already been imported and is in sys.modules when the
exception is raised.

Using pickle instead of cPickle works, but the section of the code is
performance critical.

How can this be worked around?

--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games



More information about the Python-list mailing list