Skip to content

Error display for invalid literal is incorrect #149277

@DELOLCAT

Description

@DELOLCAT

Bug report

Bug description:

If you run

0x9g

Anywhere (I did it in the REPL), the pointer that shows where the error happened is on 9, even though it is valid:

>>> 0x9g
  File "<stdin>", line 1
    0x9g
      ^
SyntaxError: invalid hexadecimal literal

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-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