In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Alex Martelli) wrote:
> Micah Elliott <[EMAIL PROTECTED]> wrote:

[... re problem killing children of shell script ...]

> > Is there any way to enable Python's subprocess module to do (implicit?)
> > group setup to ease killing of all children?  If not, is it a reasonable
> > RFE?
> 
> Not as far as I know.  It might be a reasonable request in suitable
> dialects of Unix-like OSes, though.  A setpgrp call (in the callback
> which you can request Popen to perform, after it forks and before it
> execs) might suffice... except that you can't rely on children process
> not to setpgrp's themselves, can you?!

I bet that wouldn't be a problem, though.  subprocess.Popen
constructor takes a preexec_fn parameter that looks like it
might be a suitable place to try this.  (Interesting that
it's a function parameter, not a method to be overridden by
a subclass.)

   Donn Cave, [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to