This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix the use of PyUnicode_READY()
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: benjamin.peterson, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-09-08 06:12 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3451 merged serhiy.storchaka, 2017-09-08 06:16
PR 3453 merged serhiy.storchaka, 2017-09-08 07:15
Messages (3)
msg301680 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-08 06:12
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.
msg301684 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-08 06:58
New changeset e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c by Serhiy Storchaka in branch 'master':
bpo-31393: Fix the use of PyUnicode_READY(). (#3451)
https://github.com/python/cpython/commit/e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c
msg301685 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-08 07:43
New changeset ddb536ba7b7c6022424e39d666c3cc81772645c0 by Serhiy Storchaka in branch '3.6':
[3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). (#3453)
https://github.com/python/cpython/commit/ddb536ba7b7c6022424e39d666c3cc81772645c0
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75574
2017-09-08 07:48:32serhiy.storchakasetstatus: open -> closed
assignee: serhiy.storchaka
resolution: fixed
stage: patch review -> resolved
2017-09-08 07:43:59serhiy.storchakasetmessages: + msg301685
2017-09-08 07:15:10serhiy.storchakasetpull_requests: + pull_request3450
2017-09-08 06:58:53serhiy.storchakasetmessages: + msg301684
2017-09-08 06:16:01serhiy.storchakasetkeywords: + patch
pull_requests: + pull_request3449
2017-09-08 06:12:20serhiy.storchakacreate