-
-
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 _pyio import BytesIO
memio = BytesIO(b"1234567890")
buf = memio.getbuffer()
del memio
raises an unraisable exception:
Exception ignored in: <function IOBase.__del__ at 0x7f390c69b410>
Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/_pyio.py", line 418, in __del__
self.close()
File "/home/serhiy/py/cpython/Lib/_pyio.py", line 907, in close
self._buffer.clear()
BufferError: Existing exports of data: object cannot be re-sized
Deleting a reference to object while there is still a live buffer that refers its content should not be an issue. It is not an abnormal situation and it should not produce any output.
It is only for the Python implementation. The C implementation raises an unraisable exception in different situation. See #111331.
andersk and 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