mirror of
https://github.com/python/cpython.git
synced 2026-10-28 18:35:21 +08:00
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>