[New-bugs-announce] [issue41097] confusing BufferError: Existing exports of data: object cannot be re-sized
report at bugs.python.org
Wed Jun 24 03:29:18 EDT 2020
New submission from Armin Rigo <arigo at users.sourceforge.net>:
The behavior (tested in 3.6 and 3.9) of io.BytesIO().getbuffer() gives a unexpected exception message:
>>> b = io.BytesIO()
>>> buf = b.getbuffer()
>>> b.write(b'?') # or anything up to 3 bytes
BufferError: Existing exports of data: object cannot be re-sized
The error message pretends that the problem is in resizing the BytesIO object, but the write() is not actually causing any resize.
I am not sure if the bug is a wrong error message (and all writes are supposed to be forbidden) or a wrongly forbidden write() (after all, we can use the buffer itself to write into the same area of memory).
components: Interpreter Core
stage: test needed
title: confusing BufferError: Existing exports of data: object cannot be re-sized
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce