Josiah Carlson added the comment:

First, with the use of Overlapped IO on Windows, BlockingIOError should never 
come up, and we don't even handle that exception.

As for BrokenPipeError vs. EOF; while we do treat them more or less the same, 
we aren't killing the process or reporting that the process is dead, and we 
tell users to check the results of Popen.poll() in the docs.

Could we bubble up BrokenPipeError? Sure. Does it make sense? In the case of 
Popen.communicate(), exposing the error and changing expected behavior doesn't 
make sense.

I have implemented and would continue to lean towards continuing to hide 
BrokenPipeError on the additional API endpoints. Why? If you know that a 
non-blocking send or receive could result in BrokenPipeError, now you need to 
wrap all of your communication pieces in BrokenPipeError handlers. Does it give 
you more control? Yes. But the majority of consumers of this API (and most APIs 
in general) will experience failure and could lose critical information before 
they realize, "Oh wait, I need to wrap all of these communication pieces in 
exception handlers."

I would be open to adding either a keyword-only argument to the methods and/or 
an instance attribute to enable/disable raising of BrokenPipeErrors during the 
non-blocking calls if others think that this added level of control. I would 
lean towards an instance attribute that is defaulted to False.

----------

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

Reply via email to