Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32635

Re: Avoiding defunct processes

From Nobody <nobody@nowhere.com>
Subject Re: Avoiding defunct processes
Date 2012-11-02 15:46 +0000
Message-Id <pan.2012.11.02.15.46.04.75000@nowhere.com>
Newsgroups comp.lang.python
References <b8d1fb3a-20cd-4889-900a-61ec5b64f0c1@uc4g2000pbc.googlegroups.com>
Organization Zen Internet

Show all headers | View raw


On Thu, 01 Nov 2012 19:16:17 -0700, Richard wrote:

> 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
> completes:
> $ ps e
> 6851 pts/5    Z+     1:29 [python] <defunct>

You need to either call the .wait() method, or keep calling the .poll()
method until the .returncode attribute is not None.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Avoiding defunct processes Richard <richardbp@gmail.com> - 2012-11-01 19:16 -0700
  Re: Avoiding defunct processes Chris Angelico <rosuav@gmail.com> - 2012-11-02 13:36 +1100
  Re: Avoiding defunct processes Nobody <nobody@nowhere.com> - 2012-11-02 15:46 +0000

csiph-web