[issue35869] io.BufferReader.read() returns None

Martin Panter report at bugs.python.org
Fri Feb 1 03:36:11 EST 2019


Martin Panter <vadmium+py at gmail.com> added the comment:

This is covered by Issue 13322. There are a few other BufferedReader methods that contradict the documentation for non-blocking mode.

A while ago I posted a patch to change the implementation to match the documentation, but nobody reviewed it or gave their opinion. These days I would prefer to just documentat the reality: the methods might raise an exception rather than returning None, or perhaps no particular behaviour at all is expected in general in the non-blocking case. But I don’t spend much time on Python now, so you might have to find someone else to move this forward.

Regarding the entry for “BufferedReader.read”, it would make more sense to remove the last “if”: “if ‘size’ is not given . . ., until EOF, or the ‘read’ call would block”. But I don’t think even that is complete, because it should also say the read stops and returns short in the non-blocking case even when “size” is positive.

----------
assignee:  -> docs at python
components: +Documentation, IO
nosy: +docs at python, martin.panter
superseder:  -> buffered read() and write() does not raise BlockingIOError

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35869>
_______________________________________


More information about the Python-bugs-list mailing list