◐ Shell
clean mode source ↗

Message 161400 - Python tracker

> Personally, I would factor out the code for Popen.communicate() in to a > Communicator class which wraps a Popen object and has a method
>
>    communicate(input, timeout=None) -> (bytes_written, output, error)

How would this differ from the normal communicate()?

It seems like there are two different ideas for why people want an "asynchronous subprocess":

One is that they want to use communicate() but not be limited by memory issues.
I think a good API for this case is an asyncore style API or like the one from the patch in issue1260171.

Another use case is for an expect-type interface where you read and write based on a timeout or some kind of delimiter like a newline.

These should probably be addressed independently.

See also issue10482.