zopefoundation / zodbpickle

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

Restore `noload` to its Python 2.6 functionality and provide it for PyPy #12

Closed jamadden closed 9 years ago

jamadden commented 9 years ago

As described in #9, noload was broken by the fix to Python bug 1101399, which was merged into Python 2.7. This in turn breaks code such as zc.zodbdgc.

This PR makes noload return to its 2.6 roots, but keeps the bug fix from upstream: intrinsic objects are loaded and populated, but subclasses of them are ignored.

Furthermore, because noload was only implemented in C for Python 2, it couldn't be used from PyPy, so it also adds noload to the Python implementation for Python 2.

The Python developers seem to consider 'noload' an undocumented extension, and it seems to be removed in Python 3 anyway, so to me it seems that diverging on the behaviour is probably okay.

I tested under Python 2.6, 2.7, 3.2 and 3.3, along with PyPy 2.5.1. (The tests are broken under Python 3.4, I'll try to submit another PR that adds support for 3.4 later.)

tseaver commented 9 years ago

Thanks!