STINNER Victor <vstin...@python.org> added the comment:

The script fails with "ChildProcessError: [Errno 10] No child processes" on 
line:

> os.waitpid(child.pid, 0)

The line before, you call child.kill() which sends SIGKILL signal to the 
process. So it's likely that the process will complete (killed by SIGKILL) soon.

I don't think that it's a good idea to attempt reading the process status 
directly (by calling os.waitpid), since subprocess already tracks the process 
status.

There is the public child.poll() API which calls os.waitpid(child.pid, 0) in a 
safe way for you. Why not using this API?

IMO this issue is not a bug.

Note: Python 3.8 behaves differently, but it doesn't mean that calling directly 
os.waitpid() was a good idea in Python 3.8 and older ;-)

----------
nosy: +gregory.p.smith, vstinner

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

Reply via email to