Skip to content

Fix traceback logic for non-SyntaxError exceptions in plain mode. #14964

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

Merged
merged 3 commits into from
Aug 20, 2025

Conversation

Darshan808
Copy link
Contributor

Fixes #14962

Code changes

The .msg attribute handling is now restricted to SyntaxError exceptions only.

s = value.msg
except Exception:
s = self._some_str(value)
s = self._some_str(value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should still use s = value.msg but for SyntaxError exceptionns only.

@krassowski krassowski added this to the 9.5 milestone Aug 20, 2025
@krassowski krassowski changed the title Fix traceback logic for NonSyntaxError exceptions in plain mode. Fix traceback logic for non-SyntaxError exceptions in plain mode. Aug 20, 2025
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Darshan808!

@krassowski krassowski merged commit 466ce4f into ipython:main Aug 20, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The traceback logic incorrectly prefers .msg attribute over string representation in %xmode plain
2 participants