Skip to content

Invalid error messages after GH-134077 #135422

Open
@sobolevn

Description

@sobolevn

Bug report

In #134036 (PR: #134077) I broke this use-case:

# ex.py
raise AssertionError() from None

print(1,,2)

Running ./python.exe ex.py on it produces:

» ./python.exe ex.py
  File "/Users/sobolev/Desktop/cpython/ex.py", line 1
    raise AssertionError() from None
                           ^^^^
SyntaxError: did you forget an expression after 'from'?

Which is not correct. I am fixing it right now, sorry! :(

CC @pablogsal @lysnikolaou

Linked PRs

Activity

self-assigned this
on Jun 12, 2025
added a commit that references this issue on Jun 12, 2025

pythongh-135422: Fix regression in `SyntaxError` messages after pytho…

0d94e64
added
3.15new features, bugs and security fixes
and removed on Jun 12, 2025
sobolevn

sobolevn commented on Jun 12, 2025

@sobolevn
MemberAuthor

This did not make it to 3.14, so I removed the release-blocker label. Only 3.15 is affected.

changed the title [-]Invalid error messages after #134036[/-] [+]Invalid error messages after GH-134036[/+] on Jun 14, 2025
picnixz

picnixz commented on Jun 14, 2025

@picnixz
changed the title [-]Invalid error messages after GH-134036[/-] [+]Invalid error messages after GH-134077[/+] on Jun 14, 2025

1 remaining item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Invalid error messages after GH-134077 · Issue #135422 · python/cpython

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant