Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-124363: Treat debug expressions in f-string as raw strings #128399

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 5 commits into from
Jan 22, 2025

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Jan 1, 2025

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (2)
  • Parser/action_helpers.c: Language not supported
  • Parser/lexer/lexer.c: Language not supported

@pablogsal
Copy link
Member Author

@lysnikolaou gentle ping.

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

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

Thanks for the ping @pablogsal! LGTM! Left a couple of comments to improve comments around the code.

@pablogsal pablogsal added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Jan 22, 2025
@pablogsal pablogsal enabled auto-merge (squash) January 22, 2025 16:00
@pablogsal pablogsal merged commit 60a3a0d into python:main Jan 22, 2025
45 checks passed
@pablogsal pablogsal deleted the gh-124363 branch January 22, 2025 16:24
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 22, 2025
…ythonGH-128399)

(cherry picked from commit 60a3a0d)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry, @pablogsal, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 60a3a0dd6fe140fdc87f6e769ee5bb17d92efe4e 3.12

@bedevere-app
Copy link

bedevere-app bot commented Jan 22, 2025

GH-129187 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 Jan 22, 2025
pablogsal added a commit that referenced this pull request Jan 22, 2025
…H-128399) (#129187)

gh-124363: Treat debug expressions in f-string as raw strings (GH-128399)

(cherry picked from commit 60a3a0d)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
pablogsal added a commit to pablogsal/cpython that referenced this pull request Jan 22, 2025
…rings (pythonGH-128399)

(cherry picked from commit 60a3a0d)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Jan 22, 2025

GH-129190 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Jan 22, 2025
pablogsal added a commit that referenced this pull request Jan 22, 2025
…H-128399) (#129190)

(cherry picked from commit 60a3a0d)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
@eendebakpt
Copy link
Contributor

@pablogsal This PR gives a warning in the test output:

c:\projects\misc\cpython\Lib\test\test_fstring.py:1654: SyntaxWarning: "\N" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\N"? A raw string is also an option.
  self.assertEqual(f'{b"\N{OX}"=}', 'b"\\N{OX}"=b\'\\\\N{OX}\'')

Maybe the invalid escape sequence is intentional in the test, but it would be nice if the warning is suppressed.

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.

3 participants