[issue13322] buffered read() and write() does not raise BlockingIOError

sbt report at bugs.python.org
Fri Nov 4 22:46:28 CET 2011


sbt <shibturn at gmail.com> added the comment:

> Another possibility would be that, since lines are usually reasonably
> sized, they should fit in the buffer (which is 8KB by default). So we 
> could do the extra effort of buffering the data and return it once the 
> line is complete: if the buffer fills up before we got the whole line, 
> then we could raise a RuntimeError("Partial line read"). Note that I 
> didn't check if it's easily feasible (i.e. we should avoid introducing 
> kludges in the I/O layer just to handle thi corner case).

Discarding data rarely is worse than always throwing an exception.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13322>
_______________________________________


More information about the Python-bugs-list mailing list