Author foom
Recipients
Date 2004-10-25.20:27:22
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
If you kill a python process with SIGINT (e.g. control-c), it catches 
the signal, and raises a KeyboardInterrupt. If the KeyboardInterrupt 
propagates to the top level, python exits. However, it exits with a 
result of 1, not a result of SIGINT. This means that if you run 
python in a shell script, the script will not properly exit on C-c.

When exiting because of a KeyboardInterrupt, python ought to 
reraise the SIGINT, as follows, so that the exit code is correct for 
the caller:
        signal(SIGINT, SIG_DFL);
        kill(getpid(), SIGINT);

See also http://www.cons.org/cracauer/sigint.html for a more 
detailed discussion on the topic.
History
Date User Action Args
2008-01-20 09:57:15adminlinkissue1054041 messages
2008-01-20 09:57:15admincreate