Skip to content

Syntax error display skips the first line of the traceback #125380

@SukramLeinad

Description

@SukramLeinad

Bug report

Bug description:

Steps to reproduce:

c := 3

Expected is:

Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    c := 3
      ^^
SyntaxError: invalid syntax

But the actual result is:

  File "<python-input-0>", line 1
    c := 3
      ^^
SyntaxError: invalid syntax

While the visual difference is small, it could reflect an actual bug.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixes3.14bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions