Skip to content

tokenize._all_string_prefixes does not list t-string prefixes #134675

Closed
@ericvsmith

Description

@ericvsmith

Bug report

Bug description:

tokenize._all_string_prefixes() does not include t-string prefixes.

$ ./python.bat
Running Release|x64 interpreter...
Python 3.15.0a0 (heads/main-dirty:7b1a7002312, May 25 2025, 22:44:32) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tokenize
>>> tokenize._all_string_prefixes()
{'', 'rf', 'fR', 'rF', 'Br', 'BR', 'f', 'F', 'FR', 'Fr', 'Rf', 'rb', 'rB', 'u', 'U', 'R', 'fr', 'r', 'B', 'RB', 'bR', 'br', 'Rb', 'RF', 'b'}
>>> len(_)
25

This also affects tokenize.endpats and tokenize.StringPrefix.

CPython versions tested on:

3.15

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions