This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yann
Recipients yann
Date 2021-05-02.18:46:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619981173.86.0.626727245227.issue41222@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2021-05-02 18:46:14yannsetrecipients: + yann
2021-05-02 18:46:13yannsetmessageid: <1619981173.86.0.626727245227.issue41222@roundup.psfhosted.org>
2021-05-02 18:46:13yannlinkissue41222 messages
2021-05-02 18:46:13yanncreate