Yann Dirson <y...@blade-group.com> added the comment:

With upcoming 3.10 phasing out 2.7 compatibility I have to find a solution to 
this, so I'm back digging here.

Even .read(1) on a subprocess pipe causes an underlying buffered read, so 
working around the problem by a loop of 1-byte reads has to do with os.read(), 
though its usage on file-like object is discouraged.

It looks like one of those would be needed, depending on the expected semantics 
of `POpen`'s `bufsize` parameter:

* use the provided bufsize for the underlying buffering
* provide a dummy pipe fd through fileno(), feeding it data as long as a read() 
call leaves data in the underlying buffer (indeed a simple conditional 1-byte 
read or write to the pipe before returning to caller should provide the correct 
semantics)

----------
versions: +Python 3.9

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

Reply via email to