Skip to content

gh-154711: Add tests for comments after escaped quotes in f-strings and t-strings - #158220

Open
ArneshBanerjee wants to merge 1 commit into
python:mainfrom
ArneshBanerjee:gh-154711-tests-main
Open

ArneshBanerjee wants to merge 1 commit into
python:mainfrom
ArneshBanerjee:gh-154711-tests-main

Conversation

@ArneshBanerjee

@ArneshBanerjee ArneshBanerjee commented Sep 26, 2026 •

Copy link
Copy Markdown

Adds regression tests for gh-154711: a comment after a string that ends with an escaped quote must be stripped from debug f-string output and from t-string interpolation expressions.

Main is not affected after gh-153569, and 3.14 and 3.15 already have the fix from the gh-154719 backports, but none of the existing tests cover this case. The code fix for 3.13 is in #158310.

Tests only, so I think this needs skip news.

…ings and t-strings

Main is not affected by this bug after pythongh-153569, but nothing tested it.
These tests cover a real comment placed after a string that ends with an
escaped quote, in debug f-strings and in t-string interpolations.
@bedevere-app

bedevere-app Bot commented Sep 26, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant