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
assertion failure in Python/ast.c in case of a bad unicodedata.normalize() #75773
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2017-09-30.19:54:36.492>created_at=<Date2017-09-26.12:54:08.971>labels= ['interpreter-core', '3.7', 'type-crash']
title='assertion failure in Python/ast.c in case of a bad unicodedata.normalize()'updated_at=<Date2017-09-30.19:54:36.491>user='https://github.com/orenmn'
This is because init_normalization() (in Python/ast.c) assumes that
unicodedata.normalize() is valid, and stores it in the compiling struct.
Later, new_identifier() calls the stored function, assumes it returned a
string, and passes it to PyUnicode_InternInPlace(), which asserts it is a
string.
Oh, and passing arguments to this function is tricky. If faked unicodedata.normalize save the args tuple it will see a mutated tuple containing a hanging reference.
This is a good opportunity of using the fast call protocol.
New changeset 7dc46d8 by Serhiy Storchaka (Oren Milman) in branch 'master': bpo-31592: Fix an assertion failure in Python parser in case of a bad unicodedata.normalize(). (bpo-3767) 7dc46d8
New changeset a4dfe1c by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31592: Fix an assertion failure in Python parser in case of a bad unicodedata.normalize(). (GH-3767) (bpo-3836) a4dfe1c
Activity
orenmn commentedon Sep 26, 2017
The following code causes an assertion failure:
This is because init_normalization() (in Python/ast.c) assumes that
unicodedata.normalize() is valid, and stores it in the compiling struct.
Later, new_identifier() calls the stored function, assumes it returned a
string, and passes it to PyUnicode_InternInPlace(), which asserts it is a
string.
serhiy-storchaka commentedon Sep 26, 2017
Oh, and passing arguments to this function is tricky. If faked unicodedata.normalize save the args tuple it will see a mutated tuple containing a hanging reference.
This is a good opportunity of using the fast call protocol.
serhiy-storchaka commentedon Sep 30, 2017
New changeset 7dc46d8 by Serhiy Storchaka (Oren Milman) in branch 'master':
bpo-31592: Fix an assertion failure in Python parser in case of a bad unicodedata.normalize(). (bpo-3767)
7dc46d8
serhiy-storchaka commentedon Sep 30, 2017
New changeset a4dfe1c by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31592: Fix an assertion failure in Python parser in case of a bad unicodedata.normalize(). (GH-3767) (bpo-3836)
a4dfe1c