[Python-ideas] IDEA: do not alter default SIGINT handling

Mike Meyer mwm-keyword-python.b4bdba at mired.org
Mon Sep 14 02:05:09 CEST 2009

On Mon, 14 Sep 2009 00:53:22 +0100
MRAB <python at mrabarnett.plus.com> wrote:

> Benjamin Peterson wrote:
> > Bernie Innocenti <bernie at ...> writes:
> >> If we could break the syntax of "print" statements, I'm sure we
> >> can also find a satisfactory compromise for CTRL-C handling that
> >> won't affect more than 0.1% of existing Python programs.
> > 
> > It would actually be a huge compatibility break because finally statments would
> > no longer be garunteed to execute.
> > 
> Perhaps CTRL-C could be left as-is but also have a 'stronger' version
> like SHIFT-CTRL-C.

Possibly that will work on Windows. It won't work on Posix-compliant
systems. The tty driver handles turning characters into signals to the
controlling process, and does this in the kernel. To get a keystroke
to generate some signal, you have to chose a signal the TTY driver can
generate. Further, you need to use one that's not already used for
other things.

Needing to emulate SIGINFO on a system that doesn't support it, I wind
up choosing SIGQUIT, as we don't get much use from python core dumps
from production, whereas everything else I can't see the users giving
up readily.

Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

More information about the Python-ideas mailing list