Skip to content

incorrect SyntaxError #109120

Closed
Closed

Description

@mqyhlkahu

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

Activity

  1. ambv commented on Sep 8, 2023

    @ambv
    Contributor

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

  2. sobolevn commented on Sep 8, 2023

    @sobolevn
    Member

    On 3.8 it used to be just:

      File "main.py", line 2
    
        f(A,*)
    
             ^
    
    SyntaxError: invalid syntax
    
    
  3. added
    3.11only security fixes
    3.12only security fixes
    3.13only security fixes
    on Sep 8, 2023
  4. added a commit that references this issue on Apr 2, 2024
  5. added a commit that references this issue on Apr 2, 2024
  6. added 3 commits that reference this issue on Apr 2, 2024
  7. terryjreedy commented on Apr 3, 2024

    @terryjreedy
    Member

    Should the backports be merged?

  8. added a commit that references this issue on Apr 3, 2024
  9. added a commit that references this issue on Apr 4, 2024
  10. added a commit that references this issue on Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13only 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