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
Segfault when stringifying UnicodeEncodeError (or UnicodeDecodeError) created with __new__() #65333
Comments
I'm attaching a minimal script to reproduce. I tested only with 3.2 and 2.7 versions. Its possible that it has been fixed since 3.2. |
Python 3.2 is not getting bugfixes anymore, only 3.4 and 3.5 (and 2.7). |
New changeset 140c5da3dc82 by Benjamin Peterson in branch '3.4': New changeset afa7fb2cbe3b by Benjamin Peterson in branch '2.7': New changeset 0aeaea247d7d by Benjamin Peterson in branch 'default': |
Benjamin: I don't like your change. You silently ignore the error. I would prefer to raise an exception on str(exc) if the Unicode exception object was not properly initialized. |
I don't care as long as it doesn't segfault. |
Do you have a patch Victor? |
Nope. |
An empty string is the result of str() on an instance created with __new__ for all standard exceptions except SyntaxError (str() returnns 'None' for the latter, and this looks as a bug). Since there was no complains on this issue, I think it can be closed. |
I have a complain: we should not ignore bugs. IMO an exception must be raised. |
What is the bug here (except fixed segfault)? |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: