[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-30 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset a4dfe1c9eaca6faf206f63a178233ffea208c906 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) (#3836)
https://github.com/python/cpython/commit/a4dfe1c9eaca6faf206f63a178233ffea208c906


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-30 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3817

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 7dc46d8cf5854d9f4ce3271b29c21aea4872e8ad by Serhiy Storchaka 
(Oren Milman) in branch 'master':
bpo-31592: Fix an assertion failure in Python parser in case of a bad 
unicodedata.normalize(). (#3767)
https://github.com/python/cpython/commit/7dc46d8cf5854d9f4ce3271b29c21aea4872e8ad


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-26 Thread Oren Milman

Changes by Oren Milman :


--
keywords: +patch
pull_requests: +3752
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

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.

--
nosy: +benjamin.peterson, brett.cannon, haypo, ncoghlan, serhiy.storchaka, 
yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-26 Thread Oren Milman

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com