Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ambiguous invalid syntax error for a missing comma #123123

Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
@ZeroIntensity

Description

@ZeroIntensity

Bug report

Bug description:

Trying to run the following code:

dummy_call("dummy value"foo="bar",)

results in aSyntaxError that looks like:

  File "...", line 2    "dummy value"    ^^^SyntaxError: invalid syntax. Perhaps you forgot a comma?

On 3.13+, the first three characters are also highlighted in red. I would expect the end of the line (where the comma should be) to be marked, thefoo=bar line, or possibly the entire line.

Interestingly, if you remove the indentation, then the error looks as expected:

  File "...", line 1    dummy_call("dummy value" foo="bar",)               ^^^^^^^^^^^^^^^^^SyntaxError: invalid syntax. Perhaps you forgot a comma?

CPython versions tested on:

3.12, 3.13, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp