You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ambiguous invalid syntax error for a missing comma #123123
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, the foo=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?
Activity
hugovk commentedon Aug 18, 2024
cc @pablogsal
pablogsal commentedon Aug 18, 2024
Oh this may be that some line information is not being propagated properly. Will take a look soon
pablogsal commentedon Aug 18, 2024
Seems that somehow this is a side effect of our change to always use the traceback module as I bisected this to:
pythongh-123123: Fix display of syntax errors covering multiple lines
pythongh-123123: Fix display of syntax errors covering multiple lines
gh-123123: Fix display of syntax errors covering multiple lines (#123131
pythongh-123123: Fix display of syntax errors covering multiple lines (…
[3.13] gh-123123: Fix display of syntax errors covering multiple lines (
pythongh-123123: Fix display of syntax errors covering multiple lines (…
pythongh-123123: Fix display of syntax errors covering multiple lines (…