[issue22114] You cannot call communicate() safely after receiving an exception (EINTR or EAGAIN)

STINNER Victor report at bugs.python.org
Sat Aug 2 02:24:27 CEST 2014


STINNER Victor added the comment:

> By the definition of the (blocking) communicate API, communicate can only be called once (it feeds in all the input, and reads all the output).

Since Python 3.3, communicate() can now fail with TimeoutExpired. On UNIX, it looks like it's possible to call again communicate() in this case. On Windows, the implementation is different: stdin.write() doesn't use the timeout, so the write can hang longer than the timeout :-(

Use asyncio is you want reliable and efficient communicate() on all platforms ;-)

----------

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


More information about the Python-bugs-list mailing list