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
The _PyPegen_new_identifier function normalizes to NFKC non-ASCII strings, which allows you to set keywords (None, True, False) with a different character representation as an identifier.
Found by Linux Verification Center (portal.linuxtesting.ru) with libFuzzer
Author S.Tereshin (s.tereshin@fobos-nt.ru)
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.14.0a7+ (heads/main:3dfed23092, May 6 2025, 16:44:44) [GCC 14.2.1 20250207] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> compile(source=b'Fal\xc5\xbfe', filename="<test>", mode="exec")
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
compile(source=b'Fal\xc5\xbfe', filename="<test>", mode="exec")
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: identifier field can't represent 'False' constant
Python 3.14.0a7+ (heads/main:3dfed23092, May 6 2025, 16:44:44) [GCC 14.2.1 20250207] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> compile(source=b'Fal\xc5\xbfe', filename="<test>", mode="exec")
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
compile(source=b'Fal\xc5\xbfe', filename="<test>", mode="exec")
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: identifier field can't represent 'False' constant
Configure without --with-pydebug, only --with-assertions
Activity
Fix pythongh-133516
ZeroIntensity commentedon May 6, 2025
I couldn't reproduce this:
TERESH1 commentedon May 7, 2025
Configure without
--with-pydebug, only--with-assertionsgh-133516: Raise `ValueError` when constants `True`, `False` or `None…
[3.14] gh-133516: Raise `ValueError` when constants `True`, `False` o…
[3.13] pythongh-133516: Raise `ValueError` when constants `True`, `Fa…
[3.13] pythongh-133516: Raise `ValueError` when constants `True`, `Fa…
[3.13] gh-133516: Raise `ValueError` when constants `True`, `False` o…
pythongh-133516: Raise `ValueError` when constants `True`, `False` or…