[issue25376] KeyboardInterrupt handling and traceback broken on Windows 10

2015-10-11 Thread Miikka Salminen

New submission from Miikka Salminen:

Pressing Ctrl+C to raise a KeyboardInterrupt while waiting for user input in an 
input() call yields an incomplete traceback.

The behaviour appears in a Python REPL session started by issuing "python" 
without quotes in a Windows cmd session:

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> input("Question: ")
Question: Traceback (most recent call last):
  File "", line 1, in 
>>>

When executing input_test.py (a single line Python source code file containing 
just an input("Question: ") call) from the cmd prompt by issuing "python 
input_test.py" without quotes, every other time the traceback is incomplete and 
every other time the Ctrl+C keypress yields, erroneously, an EOFError instead 
of a KeyboardInterrupt:

C:\x>python input_test.py
Question: Traceback (most recent call last):
  File "input_test.py", line 1, in 
input("Question: ")
EOFError
^C
C:\x>python input_test.py
Question: Traceback (most recent call last):
  File "input_test.py", line 1, in 

C:\x>

--
components: Interpreter Core, Windows
messages: 252800
nosy: mdf, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: KeyboardInterrupt handling and traceback broken on Windows 10
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25376] KeyboardInterrupt handling and traceback broken on Windows 10

2015-10-11 Thread Miikka Salminen

Miikka Salminen added the comment:

Did some more testing. KeyboardInterrupt traceback displays properly when 
pressing Ctrl+C during an infinite loop:

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> while True:
... pass
...
Traceback (most recent call last):
  File "", line 2, in 
KeyboardInterrupt
>>>

Also when running a file in a similar way as I did in the original bug report:

C:\x>python infinite_loop.py
Traceback (most recent call last):
  File "infinite_loop.py", line 2, in 
pass
KeyboardInterrupt

C:\x>

Could this mean that the problem is more related to reading stdin than the 
actual KeyboardInterrupt?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25376] KeyboardInterrupt handling and traceback broken on Windows 10

2015-10-11 Thread Miikka Salminen

Miikka Salminen added the comment:

Just tried the same in an IDLE session, but it seems to display the 
KeyboardInterrupt correctly:

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> input("Question: ")
Question: 
Traceback (most recent call last):
  File "", line 1, in 
input("Question: ")
  File "C:\y\Python\Python35\lib\idlelib\PyShell.py", line 1385, in readline
line = self._line_buffer or self.shell.readline()
KeyboardInterrupt
>>> 

Running the file input_test.py I meantioned in my original report doesn't seem 
to diplay anything when Ctrl+C is pressed:

= RESTART: C:\x\input_test.py =
Question: 
>>>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com