Martin Panter added the comment:

IMO it might make sense in some cases to disallow subsequent reading from a 
buffered socket reader (or probably any BufferedReader) that raises an 
exception (not just a timeout). But the restriction seems unnecessary for 
unbuffered raw readers, and it also seems to go against the “consenting adults” 
philosophy for David Murray’s test server case.

David Beazley: For non-blocking sockets, the documentation currently says “the 
socket must be in blocking mode”. I’m not sure why that restriction is 
necessary; maybe it could be lifted at least for raw unbuffered streams.

Maybe you could make an argument for caching the partial data in the 
BufferedReader if a timeout (or no more non-blocking data, or other exception) 
occurs. The biggest problem is that it could mean storing more than the normal 
buffer size. I would think this would be a new feature (for 3.6+) rather than a 
behavioural bug fix though.

And see also Issue 13322 about inconsistencies with buffered reading 
non-blocking streams in general.

----------
nosy: +martin.panter

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7322>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to