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

Antoine Pitrou report at bugs.python.org
Thu Nov 10 01:06:08 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

Hi,

> Testing the patch a bit more thoroughly, I found that data received
> from the readable end of the pipe can be corrupted by the C
> implementation.  This seems to be because two of the previously
> dormant codepaths did not properly maintain the necessary invariants.

Ouch. Were they only non-blocking codepaths?

> in two places.  However, I really do not know what all the attributes
> mean.  (Should self->raw_pos also be modified...?)

raw_pos is the position which the underlying raw stream is currently at.
It only needs to be modified when a successful write(), read() or seek()
is done on the raw stream.

Another comment: you set errno to EAGAIN, but it is not sure that was
the actual errno raised by the raw stream (although that's quite
likely). You might want to reflect the actual C errno (but you'd better
set it to 0 before the system call, then).

----------

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


More information about the Python-bugs-list mailing list