close/popen issues (bug?)

Mark Sandler Mark.Sandler at gmail.com
Wed Aug 31 22:15:36 EDT 2005


Hi,
When i create a process using popen and then if i decide that i am not
interested in keeping the process pipes anymore, and I forget the
correspond variables [for example by exiting from function which called
popen]. Then, if python tries to destroy pipes and get locked on
pipe.close(), until the child process terminates...  While this seem to
follow specifications (close waits until pipes closes on the other end,
and destructor calls close()),
it seems like a rather weird behaviour to me: i can't release pipes
until process terminates, essentially if i called popen from a
function, i should either return pipes to the outer level, or should
wait inside the function until the process terminates.

So i was wondering if it is a bug or not? (quick search on bug reports
didn't help) And if not, if there is an easy way around it...?

This behaviour is consistent on both windows/linux machines. 

mark




More information about the Python-list mailing list