GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — IDLE - support t-string prefix in colorizer · Issue #139742 · python/cpython

IDLE - support t-string prefix in colorizer #139742

New issue
Copy link
New issue
Copy link
Closed
Closed
IDLE - support t-string prefix in colorizer#139742
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IDLEtype-featureA feature request or enhancementA feature request or enhancement

Description

@Locked-chess-official
Locked-chess-official
opened on Oct 8, 2025
Issue body actions

Bug report

Bug description:

In 3.14, the t-string is supported, but the IDLE still hardcodes the string prefix pattern (r, u, b, f, rb, br, fr, rf),
but does not delegate to the standard tokenize module.

The question of the hardcodes cannot fix quickly. However, change the code in make_pat here can fix the question above:

stringprefix = r"(?i:r|u|f|t|fr|rf|b|br|rb|rt|tr)?"

If there are more supported combinations we can add them.

CPython versions tested on:

3.14

Operating systems tested on:

No response

Linked PRs

  • [3.14]gh-139742: support t-string colorization in IDLE #139747
  • gh-139742: colorize t-strings in IDLE #139754
  • gh-139742: Add support for Python 3.14 t-string prefixes in IDLE colorizer and tests #139756
  • [3.13] gh-139742: Add support for Python 3.14 t-string prefixes in IDLE colorizer and tests (GH-139756) #139830
  • [3.14] gh-139742: Add support for Python 3.14 t-string prefixes in IDLE colorizer and tests (GH-139756) #139831

Activity

  1. Locked-chess-official
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Oct 8, 2025
  2. Anuradha-Agrawal-07 commented on Oct 8, 2025

    @Anuradha-Agrawal-07
    Anuradha-Agrawal-07
    on Oct 8, 2025
    Contributor
    More actions

    Thank you for detailing both the issue and the proposed fix! Are you planning to submit a pull request for this, or is it open for others to work on? I’d like to help if the opportunity is available.

  3. StanFromIreland
    changed the title [-]Forget "t" supported in idlelib/colorizer.py[/-] [+]IDLE does not color t-string prefix[/+] on Oct 8, 2025
  4. StanFromIreland
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    topic-IDLE
    and removed
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Oct 8, 2025
  5. StanFromIreland
    added this to IDLE Issueson Oct 8, 2025
  6. terryjreedy
    changed the title [-]IDLE does not color t-string prefix[/-] [+]IDLE - support t-string prefix in colorizer[/+] on Oct 8, 2025
  7. terryjreedy commented on Oct 8, 2025

    @terryjreedy
    terryjreedy
    on Oct 8, 2025
    Member
    More actions

    Initial PR patches must be against main branch unless main should not be changed (rare).

    Insert 't' blocks based on and parallel to 'f' blocks. In colorizer.py:
    stringprefix = r"(?i:r|u|f|fr|rf|t|tr|rt|b|br|rb)?"

    The 'source' definition in idlelib/idle_test/test_colorizer.py has these two lines.

        r'x', u'x', R'x', U'x', f'x', F'x'
        fr'x', Fr'x', fR'x', FR'x', rf'x', rF'x', Rf'x', RF'x'
    

    Add 2 't' entries at the end of the first line and a 't' line after the second, 'f', line.

    Blurb: "Colorize t-string prefixes, as done with f-string prefixes."

  8. Locked-chess-official commented on Oct 8, 2025

    @Locked-chess-official
    Locked-chess-official
    on Oct 8, 2025
    ContributorAuthor
    More actions

    The change for the "test_colorizer.py" seems to be difficult. Only adding the line will cause the full test fail. Maybe it need the exactly line and offset for the new test source.

  9. terryjreedy
    added a commit that references this issue on Oct 9, 2025

    gh-139742: Add support for Python 3.14 t-string prefixes in IDLE colo…

    6fd1418
  10. miss-islington
    added 2 commits that reference this issue on Oct 9, 2025

    pythongh-139742: Add support for Python 3.14 t-string prefixes in IDL…

    7e482cb

    pythongh-139742: Add support for Python 3.14 t-string prefixes in IDL…

    2c7952b
  11. terryjreedy
    added a commit that references this issue on Oct 9, 2025

    [3.14] gh-139742: Add support for Python 3.14 t-string prefixes in ID…

    342b644
  12. picnixz
    closed this as completedon Oct 9, 2025
  13. github-project-automation
    moved this to Done in IDLE Issueson Oct 9, 2025
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

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IDLEtype-featureA feature request or enhancementA feature request or enhancement

    Projects

    • IDLE Issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.