Author Martin Ritter
Recipients Martin Ritter
Date 2017-11-03.15:01:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

I tried to use, stdout=subprocess.PIPE, timeout=N)

to run some test scripts with a given timeout. 

This works as expected with simple scripts. However if the script itself creates other children which write to stdout then `` seems to wait for all of the children to finish. I've attached a minimal example.

I looked into and `` calls `process.communicate()` again without timeout when handling the TimeoutExpired exception which then in turn waits for the pipes to be closed by all children.

If communicate() would check if the process is still alive while waiting for output and close the pipes once the process has finished the timeout feature should work as expected and descendants would get a SIGPIPE when writing to stdout/stderr.
Date User Action Args
2017-11-03 15:01:32Martin Rittersetrecipients: + Martin Ritter
2017-11-03 15:01:32Martin Rittersetmessageid: <>
2017-11-03 15:01:31Martin Ritterlinkissue31935 messages
2017-11-03 15:01:31Martin Rittercreate