Author Oren Milman
Recipients Oren Milman
Date 2017-09-26.12:54:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506430448.99.0.998378663299.issue31592@psf.upfronthosting.co.za>
In-reply-to
Content
The following code causes an assertion failure:

import unicodedata
def bad_normalize(*args):
    return None

unicodedata.normalize = bad_normalize
import ast
ast.parse('\u03D5')


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.
History
Date User Action Args
2017-09-26 12:54:09Oren Milmansetrecipients: + Oren Milman
2017-09-26 12:54:08Oren Milmansetmessageid: <1506430448.99.0.998378663299.issue31592@psf.upfronthosting.co.za>
2017-09-26 12:54:08Oren Milmanlinkissue31592 messages
2017-09-26 12:54:08Oren Milmancreate