Issue #11286: Fixed unpickling of empty 2.x strings.

This commit is contained in:
Alexander Belopolsky 2011-02-24 19:40:09 +00:00
parent 6c3787cb70
commit 1ce92dc20d
4 changed files with 12 additions and 13 deletions

View file

@ -1094,6 +1094,10 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(len(loaded), len(data))
self.assertEqual(loaded, data)
def test_empty_bytestring(self):
# issue 11286
empty = self.loads(b'\x80\x03U\x00q\x00.', encoding='koi8-r')
self.assertEqual(empty, '')
# Test classes for reduce_ex