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 — f-strings do not show warnings about invalid escapes · Issue #105800 · python/cpython

f-strings do not show warnings about invalid escapes #105800

New issue
Copy link
New issue
Copy link
Closed
Closed
f-strings do not show warnings about invalid escapes#105800
Copy link
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixes

Description

@pablogsal
pablogsal
opened on Jun 14, 2023
Issue body actions

In 3.12 and 3.13, f-strings are not warning about invalid escapes that get warnings in real strings. This seems like a bug.

>>> f'\?'
'\\?'
>>> len(f'\?')
2
>>> '\?'
<stdin>:1: SyntaxWarning: invalid escape sequence '\?'
'\\?'

_Originally posted by @terryjreedy in https://github.com/python/cpython/issues/105784#issuecomment-1591828755_
            

<!-- gh-linked-prs -->
### Linked PRs
* gh-105801
* gh-105806
<!-- /gh-linked-prs -->
Reacted by Terry Jan Reedy

Activity

  1. pablogsal
    added a commit that references this issue on Jun 14, 2023

    pythongh-105800: Issue SyntaxWarning in f-strings for invalid escape …

    8a4b38e
  2. AlexWaygood
    added
    3.12only security fixesonly security fixes
    3.13only security fixesonly security fixes
    on Jun 14, 2023
  3. miss-islington
    added a commit that references this issue on Jun 15, 2023

    pythongh-105800: Issue SyntaxWarning in f-strings for invalid escape …

    e3a46f8
  4. pablogsal
    added a commit that references this issue on Jun 15, 2023

    gh-105800: Issue SyntaxWarning in f-strings for invalid escape sequen…

    12b6d84
  5. pablogsal commented on Jun 15, 2023

    @pablogsal
    pablogsal
    on Jun 15, 2023
    MemberAuthor
    More actions

    CC: @terryjreedy

  6. pablogsal
    closed this as completedon Jun 15, 2023
  7. pablogsal
    changed the title [-]f-strings are not warning about invalid escapes[/-] [+]f-strings do not warning about invalid escapes[/+] on Jun 15, 2023
  8. pablogsal
    changed the title [-]f-strings do not warning about invalid escapes[/-] [+]f-strings do not show warnings about invalid escapes[/+] on Jun 15, 2023
  9. pablogsal
    added a commit that references this issue on Jun 15, 2023

    [3.12] gh-105800: Issue SyntaxWarning in f-strings for invalid escape…

    638c2ba
  10. carljm
    added a commit that references this issue on Jun 15, 2023

    Merge branch 'main' into modulelocals

    166aca9
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

    3.12only security fixesonly security fixes3.13only security fixesonly security fixes

    Projects

    No projects

      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.