Author vstinner
Recipients eryksun, jeremy.kloth, jkloth, nanjekyejoannah, vstinner
Date 2019-08-22.10:44:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Oh, I found an issue with regrtest and Windows processes.

On Windows, when a process dies (crash or whatever), Popen.communicate() continues to hang in the parent if the died process has at least one child process which is still alive.

Test attached
vstinner@WIN C:\vstinner\python\master>python
Running Debug|x64 interpreter...
parent pid 1600
child1 pid 2184
child2 pid 4516
communicate(): timeout (1)
child1 killed
wait() returned: returncode 1
communicate() timeout (2)

Calling Popen.communicate() hangs even if the child process has been killed, whereas wait() completes immediately.

On Windows, Popen.communicate() is implemented with threads calling this function on each pipe:

        def _readerthread(self, fh, buffer):

It seems like hangs even after the child process has been killed.
Date User Action Args
2019-08-22 10:44:50vstinnersetrecipients: + vstinner, jkloth, jeremy.kloth, eryksun, nanjekyejoannah
2019-08-22 10:44:50vstinnersetmessageid: <>
2019-08-22 10:44:50vstinnerlinkissue37531 messages
2019-08-22 10:44:50vstinnercreate