Message233864
| Author |
martin.panter |
| Recipients |
martin.panter |
| Date |
2015年01月11日.23:22:59 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1421018580.2.0.302475678575.issue23214@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Looking at the test suite:
* read1() of LZMAFile and GzipFile (both implementing BufferedIOBase) are asserted to return a non-zero result until EOF
* LZMAFile.read1(0) is asserted to return an empty string
* BufferedReader.read1(-1) is asserted to raise ValueError
* There are also tests of read1() methods on HTTPResponse and ZipFile.open() objects, but those methods are undocumented
It seems the most consistent way forward would be to:
* Define BufferedIOBase.read1(-1) to read and return an arbitrary number of bytes, more than zero unless none are available due to EOF or non-blocking mode. Maybe suggest that it would return the current buffered data or try to read a full buffer of data (with one call) and return it if applicable.
* Change the signature to BufferedReader.read1(size=-1) and implement the size=-1 behaviour |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年01月11日 23:23:00 | martin.panter | set | recipients:
+ martin.panter |
| 2015年01月11日 23:23:00 | martin.panter | set | messageid: <1421018580.2.0.302475678575.issue23214@psf.upfronthosting.co.za> |
| 2015年01月11日 23:23:00 | martin.panter | link | issue23214 messages |
| 2015年01月11日 23:22:59 | martin.panter | create |
|