mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #13505: Make pickling of bytes object compatible with Python 2.
Initial patch by sbt.
This commit is contained in:
parent
7b7e39a61f
commit
3bfc65a25b
5 changed files with 94 additions and 57 deletions
|
@ -636,9 +636,15 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
|
||||
def test_bytes(self):
|
||||
for proto in protocols:
|
||||
for u in b'', b'xyz', b'xyz'*100:
|
||||
p = self.dumps(u)
|
||||
self.assertEqual(self.loads(p), u)
|
||||
for s in b'', b'xyz', b'xyz'*100:
|
||||
p = self.dumps(s)
|
||||
self.assertEqual(self.loads(p), s)
|
||||
for s in [bytes([i]) for i in range(256)]:
|
||||
p = self.dumps(s)
|
||||
self.assertEqual(self.loads(p), s)
|
||||
for s in [bytes([i, i]) for i in range(256)]:
|
||||
p = self.dumps(s)
|
||||
self.assertEqual(self.loads(p), s)
|
||||
|
||||
def test_ints(self):
|
||||
import sys
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue