diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2008-12-27 07:08:47 +0000 |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2008-12-27 07:08:47 +0000 |
commit | f852bf97ef45e10f37938434c84b58d65b1b9a7e (patch) | |
tree | 439a2c1f154f37c6600e436b7f12e971d295552c /Lib/test/pickletester.py | |
parent | 034e08ce8daafb61bfc8e3f7c6e3b6194e05dd78 (diff) | |
download | cpython-git-f852bf97ef45e10f37938434c84b58d65b1b9a7e.tar.gz |
Fix issue #4730: cPickle corrupts high-unicode strings.
Update outdated copy of PyUnicode_EncodeRawUnicodeEscape.
Add a test case.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r-- | Lib/test/pickletester.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index bf9bca78f9..bf25245bd1 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -480,14 +480,21 @@ class AbstractPickleTests(unittest.TestCase): if have_unicode: def test_unicode(self): - endcases = [unicode(''), unicode('<\\u>'), unicode('<\\\u1234>'), - unicode('<\n>'), unicode('<\\>')] + endcases = [u'', u'<\\u>', u'<\\\\u1234>', u'<\n>', + u'<\\>', u'<\\\\U00012345>'] for proto in protocols: for u in endcases: p = self.dumps(u, proto) u2 = self.loads(p) self.assertEqual(u2, u) + def test_unicode_high_plane(self): + t = u'\U00012345' + for proto in protocols: + p = self.dumps(t, proto) + t2 = self.loads(p) + self.assertEqual(t2, t) + def test_ints(self): import sys for proto in protocols: |