KEMBAR78
gh-134582: Fix t-strings untokenize() roundtrip removing space between braces by loic-simon · Pull Request #134603 · python/cpython · GitHub
Skip to content

Conversation

@loic-simon
Copy link
Contributor

@loic-simon loic-simon commented May 23, 2025

Avoid round-tripping t"{ {}}" (an interpolation with an empty dictionary) into t"{{}}" (two literal braces).

This extend the mechanism used in tokenize.Untokenizer.compat, to handle t-strings alongside f-strings.

@pablogsal pablogsal added the needs backport to 3.14 bugs and security fixes label May 25, 2025
@pablogsal
Copy link
Member

Thanks for your contribution @loic-simon 🚀

@pablogsal pablogsal merged commit 52509cc into python:main May 25, 2025
45 checks passed
@miss-islington-app
Copy link

Thanks @loic-simon for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 25, 2025
…between braces (pythonGH-134603)

(cherry picked from commit 52509cc)

Co-authored-by: Loïc Simon <loic.pano@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented May 25, 2025

GH-134659 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 May 25, 2025
pablogsal pushed a commit that referenced this pull request May 25, 2025
… between braces (GH-134603) (#134659)

gh-134582: Fix t-strings untokenize() roundtrip removing space between braces (GH-134603)
(cherry picked from commit 52509cc)

Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
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.

2 participants