This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients ammar2, gregory.p.smith, vstinner
Date 2017-10-05.13:12:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
A colleague packaging Python for Red Hat Entreprise Linux reported me that tests hang randomly on test_exception_errpipe_bad_data() of test_subprocess. I don't know why exactly, but using strace, I noticed that the "unit test" calls os.waitpid() with the pid returned by the mocked fork_exec(): pid 0. So the test calls os.waitpid(0, 0).

In a REPL on my Fedora 26, os.waitpid(0, 0) raises "ChildProcessError: [Errno 10] No child processes". I'm not sure that waitpid() is the cause of the hang, but it doesn't seem correct to me to call waitpid() with the result of a mock function, since the mock doesn't create a real child process.

Attached PR 3896 mocks also os.waitpid() to fix this bug. I reopen the issue to discuss this bug in the new test added in this issue.
Date User Action Args
2017-10-05 13:12:25vstinnersetrecipients: + vstinner, gregory.p.smith, ammar2
2017-10-05 13:12:25vstinnersetmessageid: <>
2017-10-05 13:12:25vstinnerlinkissue31178 messages
2017-10-05 13:12:25vstinnercreate