cpython/Parser
Miss Islington (bot) 0b5f026893
[3.15] gh-160491: Fix location of invalid escapes in f-strings and t-strings (GH-160493) (#160530)
Literal parts of f-strings and t-strings are decoded only after the
whole string has been parsed, so a decode error took the location of
the last token. The resulting SyntaxError pointed at the closing quote,
and for multi-line strings it could be on the wrong line.

Raise the error at the literal part being decoded instead.
(cherry picked from commit 2258026edd)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2026-10-23 16:20:45 -07:00
..
lexer [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
tokenizer
action_helpers.c
asdl.py
asdl_c.py
myreadline.c
parser.c
peg_api.c
pegen.c
pegen.h
pegen_errors.c
Python.asdl
string_parser.c
string_parser.h
token.c