By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,621 Members | 1,104 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,621 IT Pros & Developers. It's quick & easy.

Help with PicklingError (Can't pickle x: it's not the same object as x)

P: n/a
>>> sys.platform, sys.version
('freebsd4', '2.2.3 (#2, Nov 17 2003, 17:03:14) \n[GCC 2.95.3 20010315
(release) [FreeBSD]]')

I've poured through (line 525) and see where the
PicklingError is being raised, but I can't figure out what conditions
would create the error.

It's testing a class' identity with the object's class that's being
pickled. Somewhere along the line, the original class and the class
of the instance being pickled have parted ways.

Could this have been caused by a reload(module) call somewhere along
the line? I thought that reload would only replace the module in
sys.modules if the file had changed since the original
import. I'm pretty certain that the object's class is not being
altered between the time its module was imported and the time of the
pickling attempt.

Note: the object being pickled is a subclass of 'dict'. I'm creating
a test case where my class is just a subclass of 'object' to see if
the error is related to that...

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.