Skip to content

gh-137314: Fix incorrect treatment of format specs in raw fstrings #137328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 3, 2025

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Aug 2, 2025

@pablogsal pablogsal requested a review from lysnikolaou as a code owner August 2, 2025 22:10
@pablogsal pablogsal changed the title gh-13731: Fix incorrect treatment of format specs in raw fstrings gh-137314: Fix incorrect treatment of format specs in raw fstrings Aug 2, 2025
@pablogsal pablogsal added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Aug 2, 2025
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@pablogsal
Copy link
Member Author

@Yhg1s should we backport this to 3.12? is not a security fix certianly so my default would be 'no' but my guess is that it will make maintaining linterns a pain in this area if the behaviour is different.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@pablogsal pablogsal merged commit 0153d82 into python:main Aug 3, 2025
45 checks passed
@pablogsal pablogsal deleted the gh-137314 branch August 3, 2025 16:10
@miss-islington-app
Copy link

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 3, 2025
…ngs (pythonGH-137328)

(cherry picked from commit 0153d82)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 3, 2025
…ngs (pythonGH-137328)

(cherry picked from commit 0153d82)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Aug 3, 2025

GH-137344 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Aug 3, 2025
@bedevere-app
Copy link

bedevere-app bot commented Aug 3, 2025

GH-137345 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 3, 2025
pablogsal added a commit to miss-islington/cpython that referenced this pull request Aug 3, 2025
pablogsal added a commit that referenced this pull request Aug 3, 2025
…ings (GH-137328) (#137344)

gh-137314: Fix incorrect treatment of format specs in raw fstrings (GH-137328)
(cherry picked from commit 0153d82)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit that referenced this pull request Aug 3, 2025
…ings (GH-137328) (#137345)

gh-137314: Fix incorrect treatment of format specs in raw fstrings (GH-137328)
(cherry picked from commit 0153d82)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@Yhg1s
Copy link
Member

Yhg1s commented Aug 4, 2025

@Yhg1s should we backport this to 3.12? is not a security fix certianly so my default would be 'no' but my guess is that it will make maintaining linterns a pain in this area if the behaviour is different.

Linters will probably have to consider earlier 3.12 releases anyway (at least on Windows and probably macOS, since we won't be building installers with this fix), and yeah, it's not a security fix. I don't see a particular compelling reason to backport it unless we want to reconsider the whole security-fix-only idea.

@dylwil3
Copy link
Contributor

dylwil3 commented Aug 4, 2025

@Yhg1s should we backport this to 3.12? is not a security fix certianly so my default would be 'no' but my guess is that it will make maintaining linterns a pain in this area if the behaviour is different.

Linters will probably have to consider earlier 3.12 releases anyway (at least on Windows and probably macOS, since we won't be building installers with this fix), and yeah, it's not a security fix. I don't see a particular compelling reason to backport it unless we want to reconsider the whole security-fix-only idea.

Happy to special case, but just for clarification this was a regression in 3.12, not something that held in 3.11 - so the behavior in the linter would not be "3.12 and earlier do this..." but rather "only for 3.12 do this".

@picnixz
Copy link
Member

picnixz commented Aug 4, 2025

What we meant by earlier releases is the patch version. We only release sources for security-only branches, and usually it's only Linux distributions that pick them up to so that users can upgrade their system-wide installation from their package manager. So Windows is likely to have Python 3.12.N without the fix while Linux would have the fix in 3.12.(N+1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy