[issue13322] buffered read() and write() does not raise BlockingIOError
Charles-François Natali
report at bugs.python.org
Fri Nov 4 09:24:30 CET 2011
Charles-François Natali <neologix at free.fr> added the comment:
> This is a hairy issue
Indeed.
Performing partial read/write may sound imperfect, but using buffered I/O around non-blockind FD is definitely not a good idea.
Also, the advantage of the current approach is that at least, no data is ever lost (and changing the behavior to raise a BlockingIOError might break some code out there in the wild).
Note that Java's BufferedInputStream and ReadableByteChannel also return partial reads.
So I'm somewhat inclined to keep the current behavior (it would however probably be a good idea to update the documentation to warn about this limitation, though).
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13322>
_______________________________________
More information about the Python-bugs-list
mailing list