[Python-checkins] cpython (merge default -> default): Merge heads

serhiy.storchaka python-checkins at python.org
Sat Nov 23 21:45:28 CET 2013


http://hg.python.org/cpython/rev/68b6014b3f20
changeset:   87459:68b6014b3f20
parent:      87458:8c00677da6c0
parent:      87457:eb6fd9e96015
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Nov 23 22:45:06 2013 +0200
summary:
  Merge heads

files:
  Lib/pickletools.py |  7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/Lib/pickletools.py b/Lib/pickletools.py
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -562,15 +562,16 @@
 
 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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list