Martin Panter added the comment:

Regarding special cases on the reading side, I think there should be an easy 
way to distinguish them. The existing RawIOBase way is probably as good as any, 
unless you want to take the chance to invent a better API:

* EOF (pipe closed, no more data ever) should be indicated by returning b""
* Empty pipe (still open, future data possible) should be indicated by 
returning None

Beware that BlockingIOError is normally not raised by Python’s standard 
library, despite the BufferedIOBase documentation, and I think it should say 
that way (the implementation, that is). See Issue 13322.

Regarding handling a broken pipe condition, it would be nice to have a way of 
signalling that to the caller, whether via an exception or other means. For 
example if the subprocess is a video player which gets closed early by the end 
user, it would be good to know to stop wasting time and bandwidth generating 
and piping video the the player.

----------

_______________________________________
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