zopefoundation / zodbpickle

Fork of Python's pickle module to work with ZODB
Other
17 stars 15 forks source link

`noload` broken for ZODB multi-database references #9

Closed jamadden closed 9 years ago

jamadden commented 10 years ago

Over on the zodb-dev mailing list, Jim Fulton and I got into a discussion about zc.zodbdgc being broken under Python 2.7 with both cPickle and zodbpickle.

To summarize the details of that discussion, it turns out that when cPickle in Python 2.7 fixed issue 1101399 (dict subclasses and noload) in October 2009 it wound up breaking the unpickling of the list objects that are used for persistent multi-database references: they are always empty. This in turn breaks zc.zodbdgc (with an IndexError) or anything else that wants to look at references using noload when multi-databases are involved.

This same code is in zodbpickle, so references are also broken when unpickled using this code.

It wasn't real clear what the right solution was. Jim said he wanted to think about it, at least as far as zc.zodbdgc is concerned. I hoped it would be useful to bring this issue up in this forum too if only to make sure people were aware or could find it easier if they encounter the problem.