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.

classification
Title: "TypeError: expected string, bytes found" instead of KeyboardInterrupt
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eopadoan, gvanrossum
Priority: normal Keywords:

Created on 2007-09-11 19:26 by eopadoan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg55833 - (view) Author: Eduardo Padoan (eopadoan) Date: 2007-09-11 19:26
On revision 54803, interactive mode, on linux: if type ctrl+c you type
ctrl+c, it should raise KeyboardInterrupt, but "TypeError: expected
string, bytes found" printed. Also, I could *not* catch it doing:

>>> try:
...     while True: pass
... except KeyboardInterrupt:
...     print('Ok')
... except TypeError:
...     print('Ops')
Ok

To reproduce:
>>> # press ctrl+c...
TypeError: expected string, bytes found
>>> 

It seems that it is simply printing the wrong error...
msg55867 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-09-12 19:37
Confirmed. Weird.
msg56560 - (view) Author: Eduardo Padoan (eopadoan) Date: 2007-10-19 18:15
Can't reproduce this error anymore with revision 58472.
msg56562 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-10-19 20:53
There were some seriously broken things with exception reporting, most
of which I seem to have fixed.
History
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45492
2007-10-19 20:53:48gvanrossumsetstatus: open -> closed
resolution: fixed
messages: + msg56562
2007-10-19 18:15:52eopadoansetmessages: + msg56560
2007-09-18 11:48:48jafosetpriority: normal
2007-09-12 19:37:17gvanrossumsetnosy: + gvanrossum
messages: + msg55867
2007-09-11 19:26:07eopadoancreate