New submission from Oren Milman:

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.

----------
components: Interpreter Core
messages: 303036
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: assertion failure in Python/ast.c in case of a bad 
unicodedata.normalize()
type: crash
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31592>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to