Martin Panter added the comment: 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 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23214> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com