You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PEP 688: Crash if __release_buffer__ is called while an exception is active #104371
class A:
def __buffer__(self, flags):
return memoryview(bytes(8))
def __release_buffer__(self, view):
pass # do not need to do anything here, just needs to exist
b = bytearray(8)
m = memoryview(b) # now b.extend will raise an exception due to exports
b.extend(A())
In a debug build this crashes with Assertion failed: (!PyErr_Occurred()), function _PyType_Lookup, file typeobject.c, line 4707.
Reported by @chilaxan. I'll work on a fix later today.
Most likely, the fix will be to call PyErr_Fetch/PyErr_Restore around calls to Python __release_buffer__ methods.
Activity
pythongh-104371: Fix calls to __release_buffer__ while an exception i…
gh-104371: Fix calls to `__release_buffer__` while an exception is ac…
GH-104371: check return value of calling `mv.release` (#104417)
Merge branch 'main' into supermon