Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: expected string, bytes found" instead of KeyboardInterrupt #45492

Closed
eopadoan mannequin opened this issue Sep 11, 2007 · 4 comments
Closed

"TypeError: expected string, bytes found" instead of KeyboardInterrupt #45492

eopadoan mannequin opened this issue Sep 11, 2007 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@eopadoan
Copy link
Mannequin

eopadoan mannequin commented Sep 11, 2007

BPO 1151
Nosy @gvanrossum

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2007-10-19.20:53:48.691>
created_at = <Date 2007-09-11.19:26:07.532>
labels = ['interpreter-core', 'type-bug']
title = '"TypeError: expected string, bytes found" instead of KeyboardInterrupt'
updated_at = <Date 2007-10-19.20:53:48.690>
user = 'https://bugs.python.org/eopadoan'

bugs.python.org fields:

activity = <Date 2007-10-19.20:53:48.690>
actor = 'gvanrossum'
assignee = 'none'
closed = True
closed_date = <Date 2007-10-19.20:53:48.691>
closer = 'gvanrossum'
components = ['Interpreter Core']
creation = <Date 2007-09-11.19:26:07.532>
creator = 'eopadoan'
dependencies = []
files = []
hgrepos = []
issue_num = 1151
keywords = []
message_count = 4.0
messages = ['55833', '55867', '56560', '56562']
nosy_count = 2.0
nosy_names = ['gvanrossum', 'eopadoan']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1151'
versions = ['Python 3.0']

@eopadoan
Copy link
Mannequin Author

eopadoan mannequin commented Sep 11, 2007

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...

@eopadoan eopadoan mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Sep 11, 2007
@gvanrossum
Copy link
Member

Confirmed. Weird.

@eopadoan
Copy link
Mannequin Author

eopadoan mannequin commented Oct 19, 2007

Can't reproduce this error anymore with revision 58472.

@gvanrossum
Copy link
Member

There were some seriously broken things with exception reporting, most
of which I seem to have fixed.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant