-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
UnicodeDecodeError
or SystemError
when using f-string
with lambda
and non-ASCII characters
#130618
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
topic-unicode
type-bug
An unexpected behavior, bug, or error
Comments
It seems to be a parser bug. |
On it |
The problem was introduced by:
|
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Feb 27, 2025
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Feb 27, 2025
pablogsal
added a commit
that referenced
this issue
Feb 27, 2025
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Feb 27, 2025
…python#130638) (cherry picked from commit e06bebb)
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Feb 27, 2025
…strings (pythonGH-130638) (cherry picked from commit e06bebb) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Feb 27, 2025
…strings (pythonGH-130638) (cherry picked from commit e06bebb) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Feb 27, 2025
…strings (pythonGH-130638) (cherry picked from commit e06bebb) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal
added a commit
to pablogsal/cpython
that referenced
this issue
Feb 27, 2025
…strings (pythonGH-130638) (cherry picked from commit e06bebb) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
topic-unicode
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
When using an
f-string
in combination withlambda
functions that return non-ASCII characters, either aUnicodeDecodeError
or aSystemError
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.Steps to Reproduce
Run the code with
python <file.py>
, which triggers the following error:Expected Behavior
The code should execute without raising any errors.
Actual Behavior
The following behaviors are observed when making the specified modifications. Each of these cases is independent:
、
character from the first string (foo
): No error.、
characters from the first string:SystemError: Negative size passed to PyUnicode_New
.foo=
(i.e., not passingfoo
by keyword): No error.lambda:
(i.e., making either argument or both into astr
type instead of aCallable[[], str]
): No error.bar
): No error.Other Relevant Information
The bug does not reproduce in Python 3.13.1, but it does reproduce in Python 3.13.2 and 3.12.9.
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: