mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-40596: Fix str.isidentifier() for non-canonicalized strings containing non-BMP characters on Windows. (GH-20053)
This commit is contained in:
parent
7c6e970775
commit
5650e76f63
3 changed files with 31 additions and 4 deletions
|
|
@ -720,6 +720,13 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
self.assertFalse("©".isidentifier())
|
||||
self.assertFalse("0".isidentifier())
|
||||
|
||||
@support.cpython_only
|
||||
def test_isidentifier_legacy(self):
|
||||
import _testcapi
|
||||
u = '𝖀𝖓𝖎𝖈𝖔𝖉𝖊'
|
||||
self.assertTrue(u.isidentifier())
|
||||
self.assertTrue(_testcapi.unicode_legacy_string(u).isidentifier())
|
||||
|
||||
def test_isprintable(self):
|
||||
self.assertTrue("".isprintable())
|
||||
self.assertTrue(" ".isprintable())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue