You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
str.isidentifier() does not work with non-BMP non-canonicalized strings on Windows #84776
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-05-12.13:19:12.227>created_at=<Date2020-05-11.17:50:16.125>labels= ['interpreter-core', 'type-bug', '3.9']
title='str.isidentifier() does not work with non-BMP non-canonicalized strings on Windows'updated_at=<Date2020-05-12.17:27:57.214>user='https://github.com/serhiy-storchaka'
bpo-39500: Document PyUnicode_IsIdentifier() function (GH-18397)
PyUnicode_IsIdentifier() does not call Py_FatalError() anymore if the
string is not ready.
I am not sure that changes in bpo-39500 was correct. It is easier to catch a bug if crash consistently when you pass a non-canonicalized strings then if silently return a wrong result for specific input on particular platform.
Alternatively, you could reimplement correct handling of surrogate pairs in PyUnicode_IsIdentifier().
New changeset 5650e76 by Serhiy Storchaka in branch 'master': bpo-40596: Fix str.isidentifier() for non-canonicalized strings containing non-BMP characters on Windows. (GH-20053) 5650e76
Activity
serhiy-storchaka commentedon May 11, 2020
vstinner commentedon May 11, 2020
It's maybe time to speed up the deprecation of the legacy C API using Py_UNICODE...
vstinner commentedon May 11, 2020
My previous change on this function:
commit f3e7ea5
Author: Victor Stinner <vstinner@python.org>
Date: Tue Feb 11 14:29:33 2020 +0100
serhiy-storchaka commentedon May 12, 2020
I am not sure that changes in bpo-39500 was correct. It is easier to catch a bug if crash consistently when you pass a non-canonicalized strings then if silently return a wrong result for specific input on particular platform.
Alternatively, you could reimplement correct handling of surrogate pairs in PyUnicode_IsIdentifier().
serhiy-storchaka commentedon May 12, 2020
New changeset 5650e76 by Serhiy Storchaka in branch 'master':
bpo-40596: Fix str.isidentifier() for non-canonicalized strings containing non-BMP characters on Windows. (GH-20053)
5650e76
vstinner commentedon May 12, 2020
Thanks for the fix Serhiy!