subprocess.Popen and ordering writes to stdout and stderr

Terry Reedy tjreedy at udel.edu
Thu Dec 17 18:58:36 EST 2009


On 12/17/2009 5:33 PM, Chris Withers wrote:
> exarkun at twistedmatrix.com wrote:
>> libc is probably giving you line buffering when you use os.system
>> (because the child process inherits the parent's stdio, and the
>> parent's stdio is probably a pty, and that's the policy libc implements).
>
> <snip>
>
> Interesting, but do these assertions still hold true when I tell you
> that I'm doing all this on Windows? ;-)

Which version /-)?

You can *fix* the test by sorting before comparing. If the app really 
requires synchronization of streams, I would just flush when needed and 
see if that were enough.

tjr






More information about the Python-list mailing list