[albatross-users] This example is broken

Dave Cole djc at object-craft.com.au
Thu Oct 24 15:56:55 EST 2002


>>>>> "Dave" == Dave Cole <djc at object-craft.com.au> writes:

Dave> It seems that there have been some big changes with extra checks
Dave> in the cPickle module between Python 2.1 and 2.2...

Dave> Now all of a sudden the pickler is trying to import the module
Dave> that a class belongs to.  I suspect that the code is getting
Dave> confused by our use of imp.find_module(name, [dirname]) to
Dave> import the module which contains the definition of the Node
Dave> class.

Dave> I need to do some more experiments.

I found the sequence of code which causes the problem:

>>> import cPickle, copy
>>> o = copy._EmptyClass()
>>> reload(copy)
>>> cPickle.dumps(o, 1)

The funny thing is that it only fails for binary pickles.  The
exception is caused by code which was added for 2.2 and is still in
2.3.

- Dave

-- 
http://www.object-craft.com.au




More information about the Albatross-users mailing list