sbt <shibt...@gmail.com> added the comment:

Wierdly, it looks like BlockingIO is not raised anywhere in the code for the C 
implementation of io.

Even more wierdly, in the Python implementation of io, BlockingIOError is only 
ever raised by except clauses which have already caught BlockingIOError.  So, 
of course, these clauses are dead code.

The only code in CPython which can ever succesfully raise BlockingIOError is 
MockNonBlockWriterIO.write() in test/test_io.py.

I don't know what the correct behaviour is for flush() and close() if you get 
EAGAIN.  I think flush() should raise an error rather than blocking, and that 
close() should delegate to self.raw.close() before raising the error.

The docs say that read(), readinto() and write() can raise BlockingIOError.  
But what should readall() and readline() do?  Should we just try to emulate 
whatever Python's old libc IO system did (with BlockingIOError replacing 
IOError(EAGAIN))?

----------

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

Reply via email to