Avoiding defunct processes

Richard richardbp at gmail.com
Fri Nov 2 03:16:17 CET 2012


I create child processes with subprocess.Popen().
Then I either wait for them to finish or kill them.
Either way these processes end up as defunct until the parent process
$ ps e
6851 pts/5    Z+     1:29 [python] <defunct>

This confuses another library as to whether the processes are
For now I detect which processes are defunct by parsing the output of
What would you recommend? I am hoping there is a cleaner way.


More information about the Python-list mailing list