[issue15896] Sporadic EINVAL in nonblocking pipe os.read when forked child fails on Mac OS

Charles-François Natali report at bugs.python.org
Tue Sep 18 21:02:08 CEST 2012


Charles-François Natali added the comment:

> What's wrong with working around this bug by reading a smaller amount?
> How much data is there supposed to be?

Nothing, except that there are probably other places in the stdlib
where we can get bitten by this bug. Note that this should eventually
be done for another reason, see http://bugs.python.org/issue15918

> In the work-around, we need to watch out for what 'man 2 read' on Mac OS refers to as
> "normal file":

There's nothing special actually.
This precision concerning normal file is OS-X specific, POSIX makes no
such guarantee: you can always get a short read (e.g. because of
signal delivery), so one should always call read() in a loop.

----------

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


More information about the Python-bugs-list mailing list