Skip to content

Bug with the colorizer dependent on tokenizer #140367

@Locked-chess-official

Description

@Locked-chess-official

Bug report

Bug description:

wrong_str = "
123456
123456
"

It is a SyntaxError. However, in many web page, the 123456 are colored as string.
This question appeared also in REPL. The IDLE had no this question originally, but after using tokenizer to color the codes, it appears.

Image

It may mislead the learners.

Now that the github page has no question on it, but discuss has.

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions