Skip to content

incorrect SyntaxError #109120

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
mqyhlkahu opened this issue Sep 8, 2023 · 3 comments · Fixed by #117444
Closed

incorrect SyntaxError #109120

mqyhlkahu opened this issue Sep 8, 2023 · 3 comments · Fixed by #117444
Labels
3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-parser type-bug An unexpected behavior, bug, or error

Comments

@mqyhlkahu
Copy link

mqyhlkahu commented Sep 8, 2023

Bug report

Bug description:

The following input will cause a SyntaxError. That's all well and good, but the message for the SyntaxError is incorrect.

f(A,*)
SyntaxError: iterable argument unpacking follows keyword argument unpacking

This is not correct. That error message is intended for cases like this f(**kwargs, *args).
This bug is present on 3.9, 3.10, and 3.11. I haven't tested 3.12, but I suspect that it is present there as well. The bug is not present on 3.8.

CPython versions tested on:

3.8 3.9, 3.10, 3.11

Operating systems tested on:

Linux, Windows

Linked PRs

@mqyhlkahu mqyhlkahu added the type-bug An unexpected behavior, bug, or error label Sep 8, 2023
@ambv
Copy link
Contributor

ambv commented Sep 8, 2023

Yeah, no changes in 3.12 and main for the error message.

@sobolevn
Copy link
Member

sobolevn commented Sep 8, 2023

On 3.8 it used to be just:

  File "main.py", line 2

    f(A,*)

         ^

SyntaxError: invalid syntax

@AlexWaygood AlexWaygood added 3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes labels Sep 8, 2023
@iritkatriel iritkatriel added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Nov 25, 2023
grigoriev-semyon added a commit to grigoriev-semyon/cpython that referenced this issue Apr 2, 2024
grigoriev-semyon added a commit to grigoriev-semyon/cpython that referenced this issue Apr 2, 2024
grigoriev-semyon added a commit to grigoriev-semyon/cpython that referenced this issue Apr 2, 2024
grigoriev-semyon added a commit to grigoriev-semyon/cpython that referenced this issue Apr 2, 2024
@terryjreedy
Copy link
Member

Should the backports be merged?

pablogsal pushed a commit that referenced this issue Apr 3, 2024
…essions… (#117464)

gh-109120: Fix syntax error in handlinh of incorrect star expressions (#117444)

(cherry picked from commit c97d3af)
terryjreedy pushed a commit that referenced this issue Apr 4, 2024
…essions… (#117465)

gh-109120: Fix syntax error in handlinh of incorrect star expressions (#117444)

(cherry picked from commit c97d3af)
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-parser type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants