zd nex <[email protected]> added the comment:
Hello,
so I was trying to figure out where actually is problem is. As I do not think
it is in shelve itself. So I have made different method for __setitem__ on
shelve and I have found that it is actually in pickle.dump >
Here is code which I have used
def __setitem__(self, key, value):
if self.writeback:
self.cache[key] = value
f = BytesIO()
print("set")
p = pickle.Pickler(f, self._protocol)
try:
print("before dumps - > crash",value)
p.dump(value)
print("after dump > will not be printed on crash")
except Exception as e:
print("error set",e)
print("after dump",key)
self.dict[key.encode(self.keyencoding)] = f.getvalue()
print("saved")
When in this code user changes p.dump to another method cpython crash does not
happen. Can you please try to see if it is like that?
----------
components: +Interpreter Core, ctypes
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39672>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com