zopefoundation / zodbpickle

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

Update `zodbpickle.Unpickler` to include the `find_global` support needed in ZEO #80

Closed icemac closed 4 months ago

icemac commented 11 months ago

Why haven't we updated zodbpickle.Unpickler to include the find_global support, rather than subclassing it here?

_Originally posted by @tseaver in https://github.com/zopefoundation/ZEO/pull/237#discussion_r1400992689_

here means in ZEO._compat.

tseaver commented 4 months ago

I've just been on a deep dive through the zodbpicke._pickle_33 C code, and am unconvinced that the whole find_global bit is needed. At the C level, The find_class function was bound into the module's dict as "find_global", but nothing else in the C code knows or cares about that name. In the Python3 version, there is no such name added to the dict.

The fact that ZEO jams puts its own implementation(s) into the module dict under the key "find_global" is irrelevant for any case other than pypy (assuming a Python 2.x version) or the notional PURE_PYTHON case (I doubt that one even works for anybody).