diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-10-28 21:59:39 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-10-28 21:59:39 (GMT) |
commit | b2e796aa27af76bdf0386a34a23415e3efbcc75c (patch) | |
tree | b0645c75593e8c01ba1aaf730fdc67652c2e3227 /Lib/test | |
parent | 7b1b094ff17035d35c3736bcca12229fa360d33a (diff) | |
download | cpython-b2e796aa27af76bdf0386a34a23415e3efbcc75c.zip cpython-b2e796aa27af76bdf0386a34a23415e3efbcc75c.tar.gz cpython-b2e796aa27af76bdf0386a34a23415e3efbcc75c.tar.bz2 |
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.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_pep263.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py index 05ca47f..587b2fc 100644 --- a/Lib/test/test_pep263.py +++ b/Lib/test/test_pep263.py @@ -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) |