Issue #1521: on 64bit platforms, str.decode fails on very long strings.

The t# and w# formats were not correctly handled.

Will backport.
This commit is contained in:
Amaury Forgeot d'Arc 2007-11-30 20:51:40 +00:00
parent be49a90eb3
commit dafd32b730
3 changed files with 15 additions and 7 deletions

View file

@ -65,13 +65,15 @@ class StrTest(unittest.TestCase):
self.assertEquals(s.count('i'), 1)
self.assertEquals(s.count('j'), 0)
@bigmemtest(minsize=0, memuse=1)
@bigmemtest(minsize=_2G + 2, memuse=3)
def test_decode(self, size):
pass
s = '.' * size
self.assertEquals(len(s.decode('utf-8')), size)
@bigmemtest(minsize=0, memuse=1)
@bigmemtest(minsize=_2G + 2, memuse=3)
def test_encode(self, size):
pass
s = u'.' * size
self.assertEquals(len(s.encode('utf-8')), size)
@bigmemtest(minsize=_2G, memuse=2)
def test_endswith(self, size):