You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UnicodeDecodeError or SystemError when using f-string with lambda and non-ASCII characters #130618
When using an f-string in combination with lambda functions that return non-ASCII characters, either a UnicodeDecodeError or a SystemError is raised, depending on the specific modification made to the code. These errors do not occur consistently, but rather vary based on how the lambdas and string content are altered.
❯ git bisect bad
a3797492179c249417a06d2499a7d535d453ac2c is the first bad commit
commit a3797492179c249417a06d2499a7d535d453ac2c (HEAD)
Author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Date: Wed Jan 22 01:50:22 2025 +0100
[3.13] gh-129093: Fix f-string debug text sometimes getting cut off when expression contains `!` (GH-129159) (#129163)
gh-129093: Fix f-string debug text sometimes getting cut off when expression contains `!` (GH-129159)
(cherry picked from commit 767cf708449fbf13826d379ecef64af97d779510)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Lib/test/test_fstring.py | 18 ++++++++++++++++++
Misc/NEWS.d/next/Core_and_Builtins/2025-01-21-23-35-41.gh-issue-129093.0rvETC.rst | 2 ++
Parser/lexer/lexer.c | 4 +---
3 files changed, 21 insertions(+), 3 deletions(-)
create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2025-01-21-23-35-41.gh-issue-129093.0rvETC.rst
Activity
vstinner commentedon Feb 27, 2025
It seems to be a parser bug.
cc @lysnikolaou @pablogsal
pablogsal commentedon Feb 27, 2025
On it
pablogsal commentedon Feb 27, 2025
The problem was introduced by:
pythongh-130618: Fix parser error when using lambdas inside f-strings
pythongh-130618: Fix parser error when using lambdas inside f-strings
gh-130618: Fix parser error when using lambdas inside f-strings (#130638
pythongh-130618: Fix parser error when using lambdas inside f-strings (…
[3.13] pythongh-130618: Fix parser error when using lambdas inside f-…
[3.13] pythongh-130618: Fix parser error when using lambdas inside f-…
[3.13] pythongh-130618: Fix parser error when using lambdas inside f-…
[3.12] pythongh-130618: Fix parser error when using lambdas inside f-…
[3.13] gh-130618: Fix parser error when using lambdas inside f-strings (
[3.12] gh-130618: Fix parser error when using lambdas inside f-strings (
pablogsal commentedon Mar 1, 2025
Thanks for the report @gaesa