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

MRAB python at mrabarnett.plus.com
Mon Sep 14 02:11:35 CEST 2009

Mike Meyer wrote:
> 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.
How about 2 (or 3?) in rapid succession ("here's a CTRL-C, and here's
another one to show I mean it!" :-)).

More information about the Python-ideas mailing list