diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-08-29 21:09:33 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-08-29 21:09:33 (GMT) |
commit | 82be19f889e97618d73f405ad53ceffbee462008 (patch) | |
tree | 7d9dd159ec8bd79151e0afb8dc3d2947cc859f82 /Lib/test/test_pickle.py | |
parent | aa26b275034c07784c4d64e9a2bc26c742577327 (diff) | |
download | cpython-82be19f889e97618d73f405ad53ceffbee462008.zip cpython-82be19f889e97618d73f405ad53ceffbee462008.tar.gz cpython-82be19f889e97618d73f405ad53ceffbee462008.tar.bz2 |
Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items). Instead, in most cases, an OverflowError is raised.
Diffstat (limited to 'Lib/test/test_pickle.py')
-rw-r--r-- | Lib/test/test_pickle.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py index a3878fd..9da2cae 100644 --- a/Lib/test/test_pickle.py +++ b/Lib/test/test_pickle.py @@ -7,6 +7,7 @@ from test.pickletester import AbstractPickleTests from test.pickletester import AbstractPickleModuleTests from test.pickletester import AbstractPersistentPicklerTests from test.pickletester import AbstractPicklerUnpicklerObjectTests +from test.pickletester import BigmemPickleTests try: import _pickle @@ -37,13 +38,13 @@ class PyPicklerTests(AbstractPickleTests): return u.load() -class InMemoryPickleTests(AbstractPickleTests): +class InMemoryPickleTests(AbstractPickleTests, BigmemPickleTests): pickler = pickle._Pickler unpickler = pickle._Unpickler - def dumps(self, arg, proto=None): - return pickle.dumps(arg, proto) + def dumps(self, arg, protocol=None): + return pickle.dumps(arg, protocol) def loads(self, buf, **kwds): return pickle.loads(buf, **kwds) |