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
Incorrect line reported in syntax error #86375
Comments
Attempting to parse the following python code results in a fairly unhelpful syntax error along with an incorrect line number being reported:
def dodgy(**kwargs):
print(f"{**kwargs}") The result: File "<fstring>", line 1 $ python -VV
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] |
The line number has been fixed in python 3.9: File "...\foo.py", line 5 The error message should improve when we move parsing of f-strings into the parser. I doubt we'd put in the effort to do anything before then. |
Ah, that makes sense, thank you for the info. The line number is probably the most important piece of information here anyway. It sounds like the syntax error string is already planned and as such this is probably a duplicate. Please close if this is the case. Cheers |
There are still variations of this issue in python 3.10 - the line nr is correct - in script attached it's line 2 (the attached script is otherwise the same):
resulting in: File "test.py", line 1 or is this a different but similar bug? Can this bug be reopened or should I file a new bug?
|
Arian-f's new issue is bpo-46237. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: