Skip to content

gh-126139: Improve error message location for future statement with unknown feature #126140

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
Oct 29, 2024

Conversation

brianschubert
Copy link
Contributor

@brianschubert brianschubert commented Oct 29, 2024

Fixes #126139

The error location is now set to the location of the undefined feature name:

>>> from __future__ import division, with_statement, pirnt_function
  File "<python-input-0>", line 1
    from __future__ import division, with_statement, pirnt_function
                                                     ^^^^^^^^^^^^^^
SyntaxError: future feature pirnt_function is not defined

I wasn't sure if this is noteworthy enough for a What's New entry. Let me know if I should add one.

@iritkatriel
Copy link
Member

@pablogsal Would you backdoort this?

@pablogsal
Copy link
Member

To 3.11? Unfortunately as much as I want we are past bug fix period and I don't think this qualifies as a security fix :(

@pablogsal
Copy link
Member

@pablogsal Would you backdoort this?

To other branches yes: I think this easily qualifies as a bug fix

@iritkatriel iritkatriel added type-bug An unexpected behavior, bug, or error needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Oct 29, 2024
@iritkatriel iritkatriel enabled auto-merge (squash) October 29, 2024 23:23
@iritkatriel iritkatriel merged commit 224c370 into python:main Oct 29, 2024
39 checks passed
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 29, 2024
…with unknown feature (pythonGH-126140)

(cherry picked from commit 224c370)

Co-authored-by: Brian Schubert <[email protected]>
@miss-islington-app
Copy link

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

cherry_picker 224c370a3680132997f1e43d20a3b4ca95a060ab 3.12

@bedevere-app
Copy link

bedevere-app bot commented Oct 29, 2024

GH-126155 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 29, 2024
@iritkatriel
Copy link
Member

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

cherry_picker 224c370a3680132997f1e43d20a3b4ca95a060ab 3.12

This will require a manual backport to 3.12.

brianschubert added a commit to brianschubert/cpython that referenced this pull request Oct 30, 2024
brianschubert added a commit to brianschubert/cpython that referenced this pull request Oct 30, 2024
…tement with unknown feature (pythonGH-126140)

(cherry picked from commit 224c370)

Co-authored-by: Brian Schubert <[email protected]>
brianschubert added a commit to brianschubert/cpython that referenced this pull request Oct 30, 2024
…tement with unknown feature (pythonGH-126140)

(cherry picked from commit 224c370)

Co-authored-by: Brian Schubert <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 30, 2024

GH-126160 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 Oct 30, 2024
iritkatriel pushed a commit that referenced this pull request Oct 30, 2024
… with unknown feature (GH-126140) (#126155)

gh-126139: Improve error message location for future statement with unknown feature (GH-126140)
(cherry picked from commit 224c370)

Co-authored-by: Brian Schubert <[email protected]>
iritkatriel pushed a commit that referenced this pull request Oct 30, 2024
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message locations for future statements with unknown future features
3 participants