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 — Improve error message for strings with conflicting prefixes · Issue #133197 · python/cpython

Improve error message for strings with conflicting prefixes #133197

New issue
Copy link
New issue
Copy link
Closed
Closed
Improve error message for strings with conflicting prefixes#133197
Copy link
Assignees
sobolevn
Labels
3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-featureA feature request or enhancementA feature request or enhancement

Description

@sobolevn
sobolevn
opened on Apr 30, 2025
Issue body actions

Feature or enhancement

Right now it is:

>>> ft'a'
  File "<python-input-3>", line 1
    ft'a'
      ^^^
SyntaxError: invalid syntax

I propose:

>>> ft'a'
  File "<python-input-3>", line 1
    ft'a'
      ^^^
SyntaxError: can't use both "f" and "t" prefixes for strings at the same time

cc @lysnikolaou

I am working on the issue :)

Linked PRs

  • gh-133197: Improve error message for ft"" and bt"" cases #133202
  • gh-133197: Improve error message for incompatible string / bytes prefixes #133242
Reacted by Raymond Hettinger

Activity

  1. sobolevn
    added
    3.14bugs and security fixesbugs and security fixes
    topic-parser
    type-featureA feature request or enhancementA feature request or enhancement
    on Apr 30, 2025
  2. sobolevn
    self-assigned this
    on Apr 30, 2025
  3. sobolevn
    added a commit that references this issue on Apr 30, 2025

    gh-133197: Improve error message for `ft""` and `bt""` cases (#133202)

    b451516
  4. sobolevn
    changed the title [-]Improve error message for strings that use both `f` and `t` prefix at the same time[/-] [+]Improve error message for strings with conflicting prefixes[/+] on Apr 30, 2025
  5. terryjreedy commented on Apr 30, 2025

    @terryjreedy
    terryjreedy
    on Apr 30, 2025
    Member
    More actions

    More tersely, "f" and "t" prefixes are incompatible.

    Reacted by Lysandros Nikolaou
  6. sobolevn commented on Apr 30, 2025

    @sobolevn
    sobolevn
    on Apr 30, 2025
    MemberAuthor
    More actions

    I can change the one I commited when working on new ones. I like your suggestion! Thanks!

  7. picnixz
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on May 1, 2025
  8. sobolevn
    added 2 commits that reference this issue on May 1, 2025

    pythongh-133197: Improve error message for incompatible string / byte…

    9e7d102

    gh-133197: Improve error message for incompatible string / bytes pref…

    1e9cc3d
  9. sobolevn
    closed this as completedon May 2, 2025
  10. Pranjal095
    added a commit that references this issue on Jul 12, 2025

    pythongh-133197: Improve error message for incompatible string / byte…

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

Metadata

Metadata

Assignees

  • @sobolevn
    sobolevn

Labels

3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-parsertype-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — 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.