[issue23099] BytesIO and StringIO values unavailable when closed

2015-02-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue23099] BytesIO and StringIO values unavailable when closed

2015-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset b9d4c013b09a by Serhiy Storchaka in branch 'default': Issue #23099: Closing io.BytesIO with exported buffer is rejected now to https://hg.python.org/cpython/rev/b9d4c013b09a -- ___ Python tracker

[issue23099] BytesIO and StringIO values unavailable when closed

2015-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset e62d54128bd3 by Serhiy Storchaka in branch '3.4': Issue #23099: Closing io.BytesIO with exported buffer is rejected now to https://hg.python.org/cpython/rev/e62d54128bd3 -- nosy: +python-dev ___ Python tr

[issue23099] BytesIO and StringIO values unavailable when closed

2015-02-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue23099] BytesIO and StringIO values unavailable when closed

2015-02-01 Thread Martin Panter
Martin Panter added the comment: Here is an option that moves the documentation for discarding the buffer into the class description for both BytesIO and StringIO; what do you think? I would be happy enough with any of the last three patches, so I don’t want to hold this up forever :) ---

[issue23099] BytesIO and StringIO values unavailable when closed

2015-02-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it would be good to make the documentation of BytesIO and StringIO consistent. -- ___ Python tracker ___ ___

[issue23099] BytesIO and StringIO values unavailable when closed

2015-01-31 Thread Martin Panter
Martin Panter added the comment: I can live with the wording of StringIO, but personally prefer my v2 patch. I now understand that calling close() for Bytes and StringIO objects is intended to immediately free the memory buffer holding the file data (like deleting a file in Windows). So I thin

[issue23099] BytesIO and StringIO values unavailable when closed

2015-01-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why not just copy the StringIO documentation? -- Added file: http://bugs.python.org/file37942/bytesio_exported_reject_close.v3.patch ___ Python tracker _

[issue23099] BytesIO and StringIO values unavailable when closed

2015-01-05 Thread Martin Panter
Martin Panter added the comment: Updated patch, to also document the BytesIO buffer is no longer available when closed. The StringIO documentation actually already says this, but I rarely use StringIO. :) -- Added file: http://bugs.python.org/file37611/bytesio_exported_reject_close.v2

[issue23099] BytesIO and StringIO values unavailable when closed

2014-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which rejects close() when a buffer is exported. -- keywords: +patch stage: -> patch review versions: +Python 2.7, Python 3.5 Added file: http://bugs.python.org/file37531/bytesio_exported_reject_close.patch ___

[issue23099] BytesIO and StringIO values unavailable when closed

2014-12-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Even worse, the memoryview gets corrupted on close(): The BytesIO object should probably reject closing when a buffer is exported. > writing to the file seems to be completely disallowed, even if it > would not seem to change the size: An enhancement is pro

[issue23099] BytesIO and StringIO values unavailable when closed

2014-12-22 Thread Serhiy Storchaka
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 C

[issue23099] BytesIO and StringIO values unavailable when closed

2014-12-22 Thread Martin Panter
New submission from Martin Panter: IOBase.close() doc says file operations raise ValueError, but it is not obvious to me that reading back the “file” buffer is a file operation. >>> with BytesIO() as b: ... b.write(b"123") ... 3 >>> b.getvalue() Traceback (most recent call last): File ""