summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-11-23 20:45:06 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-11-23 20:45:06 (GMT)
commita7fbf58021a54e32b500e7f964481435034fc06f (patch)
tree32fdc9ee70ca63f5b5b1c95f3fc119bf7121e198
parent5c24d0e504f9271ee095f706b493566ec0162879 (diff)
parent057e58dc01f7b1aa7fa847ffe53f742c13ee70a3 (diff)
downloadcpython-a7fbf58021a54e32b500e7f964481435034fc06f.zip
cpython-a7fbf58021a54e32b500e7f964481435034fc06f.tar.gz
cpython-a7fbf58021a54e32b500e7f964481435034fc06f.tar.bz2
Merge heads
-rw-r--r--Lib/pickletools.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index d711bf0..74b65ce 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -562,15 +562,16 @@ bytes4 = ArgumentDescriptor(
def read_bytes8(f):
r"""
- >>> import io
+ >>> import io, struct, sys
>>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
b''
>>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
b'abc'
- >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x03\x00abcdef"))
+ >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
+ >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef")) #doctest: +ELLIPSIS
Traceback (most recent call last):
...
- ValueError: expected 844424930131968 bytes in a bytes8, but only 6 remain
+ ValueError: expected ... bytes in a bytes8, but only 6 remain
"""
n = read_uint8(f)