cpython/Parser/lexer
Lysandros Nikolaou 90d0d66739
[3.15] gh-160268: Fix tokenize on a mismatched closing bracket in an f-string (GH-160272) (#160335)
Since gh-105042, `tokenize` tolerates mismatched brackets. That also let
a mismatched closing bracket pop the brace that opened an f-string
replacement field, which the f-string state relies on. In `f'{]a'`, this
triggered an assertion failure in _PyLexer_scan_string.

Check the replacement field brace in both modes.
(cherry picked from commit 86758d1950)
2026-10-22 14:50:42 -07:00
..
buffer.c [3.15] gh-155525: Fix quadratic f-string tokenization (GH-156756) (#157828) 2026-09-19 22:37:33 +00:00
buffer.h
lexer.c [3.15] gh-160268: Fix tokenize on a mismatched closing bracket in an f-string (GH-160272) (#160335) 2026-10-22 14:50:42 -07:00
lexer.h [3.15] gh-155525: Fix quadratic f-string tokenization (GH-156756) (#157828) 2026-09-19 22:37:33 +00:00
state.c [3.15] gh-155525: Fix quadratic f-string tokenization (GH-156756) (#157828) 2026-09-19 22:37:33 +00:00
state.h [3.15] gh-151464: exclude '<>' token from tokenize output (GH-154854) (#158189) 2026-09-25 19:34:04 +00:00