[issue23099] BytesIO and StringIO values unavailable when closed

Serhiy Storchaka report at bugs.python.org
Mon Dec 22 13:29:01 CET 2014


Serhiy Storchaka added the comment:

getvalue() doesn't work after close() for purpose. close() frees memory used by BytesIO.

>>> import io, sys
>>> bio = io.BytesIO()
>>> sys.getsizeof(bio)
52
>>> bio.write(b'x'*1000)
1000
>>> sys.getsizeof(bio)
1053
>>> bio.close()
>>> sys.getsizeof(bio)
52

Changing the behavior will cause regression.

The behavior of memoryview looks as a bug.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23099>
_______________________________________


More information about the Python-bugs-list mailing list