Skip to content

Error display for invalid literal is incorrect #149277

Description

@that-random-programmer

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

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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