Skip to content

SyntaxError column marker incorrect with unicode input #142539

@grayjk

Description

@grayjk

Bug report

Bug description:

The column marker/caret offset does not appear to account for characters with a display width of two.

Does not appear to be REPL related. The SyntaxError output is the same when running python test.py

Current behavior

>>> 女女女=1; 女女女/
  File "<python-input-0>", line 1
    女女女=1; 女女女/
               ^
SyntaxError: invalid syntax

The column marker/caret does not point to the column after the /

Expected behavior

>>> 女女女=1; 女女女/
  File "<python-input-0>", line 1
    女女女=1; 女女女/
                   ^
SyntaxError: invalid syntax

The column marker/caret points to the column after the /

CPython versions tested on:

3.14.1, 3.15.0a2

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions