- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
➜
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.
Created on 2017-09-26 12:54 by Oren Milman, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3767 | merged | Oren Milman, 2017-09-26 14:40 | |
| PR 3836 | merged | python-dev, 2017-09-30 17:16 |
| Messages (4) | ||
|---|---|---|
| msg303036 - (view) | Author: Oren Milman (Oren Milman) * | Date: 2017-09-26 12:54 |
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.
|
||
| msg303043 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2017-09-26 14:36 |
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. |
||
| msg303416 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2017-09-30 17:16 |
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 |
||
| msg303420 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2017-09-30 19:51 |
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 |
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:52 | admin | set | github: 75773 |
| 2017-09-30 19:54:36 | serhiy.storchaka | set | status: open -> closed stage: patch review -> resolved resolution: fixed versions: + Python 3.6 |
| 2017-09-30 19:51:42 | serhiy.storchaka | set | messages: + msg303420 |
| 2017-09-30 17:16:35 | python-dev | set | pull_requests: + pull_request3817 |
| 2017-09-30 17:16:29 | serhiy.storchaka | set | messages: + msg303416 |
| 2017-09-26 14:40:15 | Oren Milman | set | keywords:
+ patch stage: patch review pull_requests: + pull_request3752 |
| 2017-09-26 14:36:07 | serhiy.storchaka | set | nosy:
+ yselivanov, benjamin.peterson, serhiy.storchaka, vstinner, brett.cannon, ncoghlan messages: + msg303043 |
| 2017-09-26 12:54:08 | Oren Milman | create |
Powered by Roundup Copyright © 1990-2022, Python Software Foundation
Legal Statements

