Nicolas Michaux wrote:
> 2) when you call popen2 class (and others) with commands in pileline, python 
> spawns a child with a shell to start multiple jobs for your pipes : you lose 
> the pid of these jobs and can't kill them later. 
> I found a workaround by setting the shell child a process group leader. I add 
> this line in util.popen3 in Popen4 class in _run_child function : 
> "os.setpgid(0, os.getpid())". Now you can kill the whole process tree by 
> calling os.kill(-child.pid, signal).

It should also work if you use lists and not a string for starting the
command: using "program arg1 arg2" should start a subshell,
["program", 'arg1", "arg2" ] should not.


Dischi

-- 
Drag me, drop me, treat me like an object!


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to