Message309787
Looks like you want to use a "readinto" method to reduce data copying.
One problem is that it is not specified exactly what kind of object "copyfileobj" supports reading from. The documentation only says "file-like". According to the glossary, this means io.RawIOBase, BufferedIOBase, or TextIOBase. However TextIOBase doesn't have a "readinto" method. And it wouldn't be hard to find that someone has written their own class that doesn't have "readinto" either.
The other problem is you still need to support a negative "length" value, which is easier to do by calling "read". |
|
Date |
User |
Action |
Args |
2018-01-11 00:58:03 | martin.panter | set | recipients:
+ martin.panter, YoSTEALTH |
2018-01-11 00:58:03 | martin.panter | set | messageid: <1515632283.8.0.467229070634.issue32529@psf.upfronthosting.co.za> |
2018-01-11 00:58:03 | martin.panter | link | issue32529 messages |
2018-01-11 00:58:03 | martin.panter | create | |
|