With various versions of console Python 2.3.x under Windows 2000, executed using the "Python (command- line)" Start Menu shortcut, I have noticed the following intermittent errors: 1. When pressing Ctrl-C at the prompt, Python terminates. 2. When pressing Ctrl-C during a raw_input, Python raises an EOFError instead of KeyboardInterrupt. I usually cannot duplicate this behaviour by repeatedly pressing Ctrl-C or repeating the steps that led to it.
Logged In: YES user_id=1055057 It *is* intermittent. Try entering the tutorial examples (copy and paste) and pressing Ctrl-C at random. That works for me. Here's another example: today I rebooted, then later clicked on the "Python (command-line)" shortcut. I typed 1 and pressed ENTER. I then pressed Ctrl-C. Boom. Window disappears. I tried again around 20 times -- it gave a KeyboardInterrupt each time, as it should.
Logged In: YES user_id=915320 I just had this too. Ctrl-C in a raw_input() caused it to crash with a KeyboardInterrupt associated with the raw_input line... which would be fine were it not for the fact that that line was inside a try...except KeyboardInterrupt: pass (at top level). Running the same code again behaves properly (exits silently). The relevant section of the code was: try: while 1: print ">>", x = raw_input() #... except KeyboardInterrupt: pass # ctrl-c except EOFError: pass # ctrl-d/ctrl-z I'd had the window open for a long time while doing other things and then woke it with ctrl-C, so it may well be a "what happens when python is paged out/slow to respond" thing. This was "Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32" (Win2k)
Logged In: YES user_id=915320 A quick search for "ctrl-c" turns up these bugs which look related to me, the last one offers an explanation: 875692 Ctrl-C doesn't work with sleepy main thread 846817 control-c is being sent to child thread rather than main 926423 socket timeouts + Ctrl-C don't play nice