mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
in wide builds, avoid storing high unicode characters from source code with surrogates
This is accomplished by decoding with utf-32 instead of utf-16 on all builds. The patch is by Adam Olsen.
This commit is contained in:
parent
7b1b094ff1
commit
b2e796aa27
3 changed files with 25 additions and 9 deletions
|
@ -36,6 +36,14 @@ class PEP263Test(unittest.TestCase):
|
|||
exec(c, d)
|
||||
self.assertEquals(d['\xc6'], '\xc6')
|
||||
|
||||
def test_issue3297(self):
|
||||
c = compile("a, b = '\U0001010F', '\\U0001010F'", "dummy", "exec")
|
||||
d = {}
|
||||
exec(c, d)
|
||||
self.assertEqual(d['a'], d['b'])
|
||||
self.assertEqual(len(d['a']), len(d['b']))
|
||||
self.assertEqual(ascii(d['a']), ascii(d['b']))
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(PEP263Test)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue