Skip to content

gh-109179: Fix traceback display for SyntaxErrors with notes #109197

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 7 commits into from
Sep 11, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Sep 9, 2023

Since the syntax errors get replaced by the message in print_exception_file_and_line, the notes get lost.
This fixes the bug by extracting the notes before the call to print_exception_file_and_line.

Fixes #109179.

@iritkatriel iritkatriel added type-bug An unexpected behavior, bug, or error needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Sep 9, 2023
@iritkatriel iritkatriel requested review from pablogsal and removed request for pablogsal September 9, 2023 20:43
@iritkatriel iritkatriel marked this pull request as ready for review September 9, 2023 20:43
@iritkatriel iritkatriel added 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section and removed awaiting core review labels Sep 9, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 8311931 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Sep 9, 2023
@iritkatriel iritkatriel added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Sep 9, 2023
@AlexWaygood
Copy link
Member

The refleak buildbots appear to have been broken by #109177

iritkatriel and others added 3 commits September 9, 2023 22:03
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood AlexWaygood added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Sep 9, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @AlexWaygood for commit c00b658 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Sep 9, 2023
@miss-islington
Copy link
Contributor

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @iritkatriel, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker ecd21a629a2a30bcae89902f7cad5670e9441e2c 3.12

@miss-islington
Copy link
Contributor

Sorry, @iritkatriel, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker ecd21a629a2a30bcae89902f7cad5670e9441e2c 3.11

@bedevere-app
Copy link

bedevere-app bot commented Sep 11, 2023

GH-109280 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Sep 11, 2023
iritkatriel added a commit to iritkatriel/cpython that referenced this pull request Sep 11, 2023
iritkatriel added a commit to iritkatriel/cpython that referenced this pull request Sep 11, 2023
iritkatriel added a commit to iritkatriel/cpython that referenced this pull request Sep 11, 2023
@bedevere-app
Copy link

bedevere-app bot commented Sep 11, 2023

GH-109283 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Sep 11, 2023
kumaraditya303 pushed a commit that referenced this pull request Sep 12, 2023
…109197) (#109283)

gh-109179: Fix traceback display for SyntaxErrors with notes (#109197)

(cherry picked from commit ecd21a6)
Yhg1s pushed a commit that referenced this pull request Oct 2, 2023
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

Successfully merging this pull request may close these issues.

Notes added to "SyntaxError" (and subclasses) are not displayed
5 participants