mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
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:
parent
be49a90eb3
commit
dafd32b730
3 changed files with 15 additions and 7 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue