This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 tim.golden
收信人 David.Gilman, loewis, tim.golden
日期 2013-05-25.20:30:37
SpamBayes Score -1.0
Marked as misclassified
Message-id <1369513838.33.0.115378342996.issue18040@psf.upfronthosting.co.za>
In-reply-to
内容
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?
历史
日期 用户 动作 参数
2013-05-25 20:30:38tim.golden修改recipients: + tim.golden, loewis, David.Gilman
2013-05-25 20:30:38tim.golden修改messageid: <1369513838.33.0.115378342996.issue18040@psf.upfronthosting.co.za>
2013-05-25 20:30:38tim.golden链接issue18040 messages
2013-05-25 20:30:37tim.golden创建