Closing pipes

Tom Chance tomchance at gmx.net
Sat Mar 15 19:40:24 EST 2003


Hullo,

I've got a bit of code that opens a new pipe with os.popen, to start
mencoder. When I call the close() function on it, it takes an unacceptably
long time to close the pipe and return to the main thread.

I've tried using popen2.popen2 to open and close the thread, and this will
close the thread instantly, but rather than killing the process, it simply
seems to detach itself from the thread and return python to its main
thread.

Is it simply an unavoidable feature of python and its pipe support that it
will take quite a while to kill a process? Is there any way I can kill the
process more quickly?

Tom




More information about the Python-list mailing list