Skip to content

Incorrect syntax error #133999

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

Closed
tom-pytel opened this issue May 14, 2025 · 1 comment
Closed

Incorrect syntax error #133999

tom-pytel opened this issue May 14, 2025 · 1 comment
Assignees
Labels
3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker topic-parser type-bug An unexpected behavior, bug, or error

Comments

@tom-pytel
Copy link
Contributor

tom-pytel commented May 14, 2025

Bug report

Bug description:

>>> try: 1/0
... except Exception as exc: raise from exc
... 
  File "<python-input-0>", line 2
    except Exception as exc: raise from exc
                        ^^^
SyntaxError: cannot use except statement with name

Should be:

>>> try: 1/0
... except: raise from ValueError()
... 
  File "<python-input-2>", line 2
    except: raise from ValueError()
                  ^^^^
SyntaxError: invalid syntax

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

Linux

Linked PRs

@tom-pytel tom-pytel added the type-bug An unexpected behavior, bug, or error label May 14, 2025
@sobolevn sobolevn self-assigned this May 14, 2025
@sobolevn
Copy link
Member

This is a regression from my commit. Sorry! Fixing

@sobolevn sobolevn added release-blocker 3.14 bugs and security fixes labels May 14, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 15, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 15, 2025
@picnixz picnixz added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 15, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 19, 2025
…4035)

(cherry picked from commit 84914ad)

Co-authored-by: sobolevn <mail@sobolevn.me>
sobolevn added a commit that referenced this issue May 19, 2025
…#134206)

gh-133999: Fix `except` parsing regression in 3.14 (GH-134035)
(cherry picked from commit 84914ad)

Co-authored-by: sobolevn <mail@sobolevn.me>
@hugovk hugovk closed this as completed May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker topic-parser type-bug An unexpected behavior, bug, or error
Projects
Development

No branches or pull requests

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy