KeyboardInterrupt should not kill subprocess

Donn Cave donn at u.washington.edu
Fri Feb 22 02:25:45 CET 2008


In article <625r3oF21uf4hU1 at mid.uni-berlin.de>,
 Michael Goerz <newsgroup898sfie at 8439.e4ward.com> wrote:


> But as it seems, a keyboard interrupt will automatically pass down to 
> the subprocesses, causing them to abort. Is there a way that I can 
> prevent the subprocesses from being canceled by a keyboard interrupt?


You might try posix.setsid(), from the child fork.

The object is to get the child fork out of the foreground
process group for the Berkeley terminal driver.  This defines
who gets signals, when they originate in terminal control keys.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list