[issue26720] memoryview from BufferedWriter becomes garbage

Serhiy Storchaka report at bugs.python.org
Tue Apr 12 15:39:06 EDT 2016


Serhiy Storchaka added the comment:

I meant getting rid of memoryview at all and passing bytes buffer object directly to underlying write. But now I see that this idea perhaps is not feasible since we must write not only from the start of the buffer.

A writer like AuditableBytesIO is very attractive implementation. I used it multiple times, especially in tests. Your initial proposition LGTM, and perhaps this is only the solution applicable in maintained releases. Thus we should implement it in any case. In 3.6 we can add a warning.

Note that there are two kinds of references to a buffer: a reference to memoryview object and new memoryview that refers to the same buffer.

----------

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


More information about the Python-bugs-list mailing list