It depends mostly on how the spawned process handles conditions like
closed pipes, EOF, etc.

In general and on *nix, any spawned and terminated process will become
and remain a zombie until "reaped", i.e. until the final status is
collected by a calling os.waitpid().

To avoid zombies, you should call the poll() or wait() method of the
Popen3 object created for each spawned process or call os.waitpid().
The problem is that the popen* functions only return the pipe objects
and not the Popen3 instance nor the process id.   

Take a look at the source code of the popen2 module which is the file
.../Lib/popen2.py in your python installation.  It is straightforward
to create your own popen* functions and keep the Popen3 instance.

/Jean Brouwers



In article <[EMAIL PROTECTED]>, Evgeni
Sergeev <[EMAIL PROTECTED]> wrote:

> After I opened streams to a process using popen2, popen3 or popen4,
> will closing every one of the streams terminate the process?
> 
> Is there assurance that the process will terminate and not sit
> in memory orphaned, waiting on its stdin, for example?
> 
>     Evgeni Sergeev
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to