This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients benjamin.peterson, martin.panter, pitrou, serhiy.storchaka, stutzbach
Date 2016-04-12.13:39:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I realize there is another problem, and doing tricks with a bytes object won’t help that. BufferedWriter bypasses its own buffer for large writes:

>>> writer = BufferedWriter(Raw())
>>> large = bytearray(10000)
>>> writer.write(large)
>>> written.tobytes()[:10]
>>> large[:5] = b"blaua"
>>> written.tobytes()[:10]

BufferedWriter is passing a view of the original input through, without any copying. Perhaps the simplest thing is to warn and prevent the user from accessing the buffer after write() returns. I suggested some imperfect ideas in Issue 15994. Maybe I should just close this as a duplicate.
Date User Action Args
2016-04-12 13:39:11martin.pantersetrecipients: + martin.panter, pitrou, benjamin.peterson, stutzbach, serhiy.storchaka
2016-04-12 13:39:11martin.pantersetmessageid: <>
2016-04-12 13:39:11martin.panterlinkissue26720 messages
2016-04-12 13:39:10martin.pantercreate