-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Open
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
The following code
from io import BytesIO
memio = BytesIO(b"1234567890")
buf = memio.getbuffer()
del memio
a = [buf]
del buf
a.append(a)
del a
import gc
gc.collect()
raises an unraisable exception:
Exception ignored in: <_io.BytesIO object at 0x7fe2404d0d70>
Traceback (most recent call last):
File "<python-input-9>", line 1, in <module>
BufferError: Existing exports of data: object cannot be re-sized
Unraisable exception during garbage collection is a sign of a bug.
It is only for the C implementation. The Python implementation raises an unraisable exception in different situation. See #111330.
sakurai-youhei
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error