STINNER Victor <victor.stin...@gmail.com> added the comment:

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.

----------
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31178>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to