summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-08-21 22:13:11 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-08-21 22:13:11 (GMT)
commit19c35bba5d54ac2c2990d301426c7e9ecb1c6ff5 (patch)
tree088856b2b91c5e20389efaeb7e8eadd7b7b9316b /Lib/test/test_unicode.py
parentbebdc9e52c87373188d7f90b14e8acf1db1dfdc5 (diff)
downloadcpython-19c35bba5d54ac2c2990d301426c7e9ecb1c6ff5.zip
cpython-19c35bba5d54ac2c2990d301426c7e9ecb1c6ff5.tar.gz
cpython-19c35bba5d54ac2c2990d301426c7e9ecb1c6ff5.tar.bz2
- Patch #1541585: fix buffer overrun when performing repr() on
a unicode string in a build with wide unicode (UCS-4) support. I will forward port to 2.6. Can someone backport to 2.4?
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 34f9371..1bc15ae 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -92,6 +92,10 @@ class UnicodeTest(
"\\xfe\\xff'")
testrepr = repr(u''.join(map(unichr, xrange(256))))
self.assertEqual(testrepr, latin1repr)
+ # Test repr works on wide unicode escapes without overflow.
+ self.assertEqual(repr(u"\U00010000" * 39 + u"\uffff" * 4096),
+ repr(u"\U00010000" * 39 + u"\uffff" * 4096))
+
def test_count(self):
string_tests.CommonTest.test_count(self)