Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-134582: Fix t-strings untokenize() roundtrip removing space between braces #134603

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 2 commits into from
May 25, 2025

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>
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.