[Python-Dev] subprocess crossplatformness and async communication

Martin v. Loewis loewis at informatik.hu-berlin.de
Mon Jan 26 22:55:29 CET 2009


> Can this really be made safe without an explicit flow control protocol,
> such as a pseudo-TTY?  stdio reads data from pipes such as stdin in 4K
> or so chunks.

I don't think the subprocess module uses stdio.

> I can easily imagine the child blocking while it waits
> for its stdin buffer to fill, while the parent in turn blocks waiting
> for the child's output arrive.

That would be a bug in the parent process, for expecting output when
none will arrive. As a consequence, some child programs might not be
suitable for this kind of operation. This is no surprise - some programs
are not suitable for automated operation at all, because they bring
up windows, and communicate with their environment by means other than
stdin and stdout (or, if you want to operate them automatically, you
have to use AppleScript, or COM).

Regards,
Martin


More information about the Python-Dev mailing list