zopefoundation / persistent

automatic persistence for Python objects
https://pypi.org/project/persistent/
Other
46 stars 28 forks source link

AttributeError: '_WeakValueDictionary' object has no attribute '_addr_to_oid' #150

Closed jamadden closed 3 years ago

jamadden commented 4 years ago

Seen during test teardown of a large app using CPython in PURE_PYTHON=1 mode

From callback for ffi.gc <cdata 'struct CPersistentRingCFFI_struct *' owning 24 bytes>:
Traceback (most recent call last):
  File "//persistent/persistent/picklecache.py", line 105, in cleanup_hook
    oid = self._addr_to_oid.pop(cdata.pobj_id, None)
AttributeError: '_WeakValueDictionary' object has no attribute '_addr_to_oid'

This is ignored, and the dict is already gone, so there shouldn't be any harm, but it is annoying.

jamadden commented 3 years ago

This also shows up testing BTrees in PURE_PYTHON mode.

.............From callback for ffi.gc <cdata 'struct CPersistentRingCFFI_struct *' owning 24 bytes>:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/persistent/picklecache.py", line 105, in cleanup_hook
    oid = self._addr_to_oid.pop(cdata.pobj_id, None)
AttributeError: '_WeakValueDictionary' object has no attribute '_addr_to_oid'
From callback for ffi.gc <cdata 'struct CPersistentRingCFFI_struct *' owning 24 bytes>:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/persistent/picklecache.py", line 105, in cleanup_hook
    oid = self._addr_to_oid.pop(cdata.pobj_id, None)
AttributeError: '_WeakValueDictionary' object has no attribute '_addr_to_oid'
From callback for ffi.gc <cdata 'struct CPersistentRingCFFI_struct *' owning 24 bytes>:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/persistent/picklecache.py", line 105, in cleanup_hook
    oid = self._addr_to_oid.pop(cdata.pobj_id, None)
AttributeError: '_WeakValueDictionary' object has no attribute '_addr_to_oid'
From callback for ffi.gc <cdata 'struct CPersistentRingCFFI_struct *' owning 24 bytes>:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/persistent/picklecache.py", line 105, in cleanup_hook
    oid = self._addr_to_oid.pop(cdata.pobj_id, None)
AttributeError: '_WeakValueDictionary' object has no attribute '_addr_to_oid'
......................................s...From callback for ffi.gc <cdata 'struct CPersistentRingCFFI_struct *' owning 24 bytes>:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/site-packages/persistent/picklecache.py", line 105, in cleanup_hook
    oid = self._addr_to_oid.pop(cdata.pobj_id, None)
AttributeError: '_WeakValueDictionary' object has no attribute '_addr_to_oid'