cpython/Parser/lexer
Arnesh 4192eadc82
[3.13] gh-154711: Strip comments after escaped quotes in f-string debug text (#158310)
When a replacement field ended with a string that had an escaped quote and
was followed by a comment, the comment leaked into the debug f-string output.

The comment detection loop in set_fstring_expr skips escaped characters, but
the comment stripping loop did not. So an escaped quote left the scanner
thinking it was still inside a string, and the comment was never removed.

This makes the stripping loop skip escaped characters the same way the
detection loop does. 3.14 and later already have this fix from gh-154719.
2026-09-29 23:45:21 +01:00
..
buffer.c [3.13] gh-155525: Fix quadratic f-string tokenization (GH-156756) (#157830) 2026-09-19 22:31:16 +00:00
buffer.h
lexer.c [3.13] gh-154711: Strip comments after escaped quotes in f-string debug text (#158310) 2026-09-29 23:45:21 +01:00
lexer.h [3.13] gh-155525: Fix quadratic f-string tokenization (GH-156756) (#157830) 2026-09-19 22:31:16 +00:00
state.c [3.13] gh-155525: Fix quadratic f-string tokenization (GH-156756) (#157830) 2026-09-19 22:31:16 +00:00
state.h [3.13] gh-151464: exclude '<>' token from tokenize output (GH-154854) (#158191) 2026-09-25 19:20:09 +00:00