[issue18040] SIGINT catching regression on windows in 2.7

Tim Golden report at bugs.python.org
Sat May 25 22:30:38 CEST 2013


Tim Golden added the comment:

My initial reaction is that, whether the 2.7 behaviour is faulty or not, I can't reproduce the "correct" behaviour on any version of Windows going back to 2.4. Take the attached Python file issue18040.py and run "c:\pythonxx\python.exe -i issue18040.py" for any version of Python from 2.4 to 3.4. At the interpreter prompt, pressing Ctrl-C produces "Keyboard Interrupt" consistently (except for the few times it exits the interpreter which is the problem fixed in issue1677).

Note that this applies to pressing Ctrl-C *at the interpreter prompt* (while the running code is the function my_fgets in parser/myreadline.c). Pressing Ctrl-C in other circumstances, eg in the middle of a long-running os.walk or a time.sleep, invokes the signal handler as expected.

I don't know if the handler *should* be invoked at the interpreter prompt. I recognise that it does so under Linux, but are there any circumstances where that would actually be useful?

----------
assignee:  -> tim.golden
Added file: http://bugs.python.org/file30370/issue18040.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18040>
_______________________________________


More information about the Python-bugs-list mailing list