Message263172
To create a memoryview with unlimited lifetime, I understand we need to nominate an “exporting object”, which becomes memoryview.obj. Using a bytes object here might be the simplest fix for just BufferedWriter.
However it looks like the buffer is shared with BufferedReader and others. To fix the analogous bug with BufferedReader, a bytearray might be better, because the user could see it being mutated when reading into the memoryview.
I think bytearray might be okay for BufferedWriter too, as long as we prevent it being resized. The user would be able to alter the contents of the buffer, but I don’t see that as a problem. An alternative would be a new opaque object that doesn’t do much except have a reference count. |
|
Date |
User |
Action |
Args |
2016-04-11 09:29:54 | martin.panter | set | recipients:
+ martin.panter, pitrou, benjamin.peterson, stutzbach, serhiy.storchaka |
2016-04-11 09:29:54 | martin.panter | set | messageid: <1460366994.81.0.301546229033.issue26720@psf.upfronthosting.co.za> |
2016-04-11 09:29:54 | martin.panter | link | issue26720 messages |
2016-04-11 09:29:54 | martin.panter | create | |
|