summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorKristján Valur Jónsson <sweskman@gmail.com>2013-03-20 21:26:33 (GMT)
committerKristján Valur Jónsson <sweskman@gmail.com>2013-03-20 21:26:33 (GMT)
commit61683625096676722dc487aa1e9894a5b604e220 (patch)
tree1b52998a07659e8d46dd4f58d600ae55f9419376 /Lib
parente178187bf639f0af8cc9c2b97d5358918c4b2c9e (diff)
downloadcpython-61683625096676722dc487aa1e9894a5b604e220.zip
cpython-61683625096676722dc487aa1e9894a5b604e220.tar.gz
cpython-61683625096676722dc487aa1e9894a5b604e220.tar.bz2
Issue #16475 : Correctly handle the EOF when reading marshal streams.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_marshal.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index 16e6d81..c817caf 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -283,6 +283,11 @@ class BugsTestCase(unittest.TestCase):
unicode_string = 'T'
self.assertRaises(TypeError, marshal.loads, unicode_string)
+ def _test_eof(self):
+ data = marshal.dumps(("hello", "dolly", None))
+ for i in range(len(data)):
+ self.assertRaises(EOFError, marshal.loads, data[0: i])
+
LARGE_SIZE = 2**31
pointer_size = 8 if sys.maxsize > 0xFFFFFFFF else 4