New submission from Serhiy Storchaka:

PyUnicode_READY() raises an exception when returns -1 (MemoryError or 
ValueError). Not all code that calls PyUnicode_READY() handles this property. 
The following PR fixes all uses of PyUnicode_READY().

* If PyUnicode_READY() returns -1 the caller should either fail immediately or 
clear the error.

* The raised exception shouldn't be replaced by PyErr_BadArgument().

* In MCACHE_CACHEABLE_NAME PyUnicode_READY() is replaced with 
PyUnicode_IS_READY(). This is just the check for fast path.

----------
components: Interpreter Core
messages: 301680
nosy: benjamin.peterson, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fix the use of PyUnicode_READY()
type: crash
versions: Python 3.6, Python 3.7

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

Reply via email to