mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #23914: Fixed SystemError raised by unpickler on broken pickle data.
This commit is contained in:
parent
b6aa5375d5
commit
e9b3074cf9
4 changed files with 105 additions and 4 deletions
|
|
@ -32,6 +32,7 @@ class PickleTests(AbstractPickleModuleTests):
|
|||
class PyUnpicklerTests(AbstractUnpickleTests):
|
||||
|
||||
unpickler = pickle._Unpickler
|
||||
bad_stack_errors = (IndexError,)
|
||||
|
||||
def loads(self, buf, **kwds):
|
||||
f = io.BytesIO(buf)
|
||||
|
|
@ -62,6 +63,7 @@ class InMemoryPickleTests(AbstractPickleTests, AbstractUnpickleTests,
|
|||
|
||||
pickler = pickle._Pickler
|
||||
unpickler = pickle._Unpickler
|
||||
bad_stack_errors = (pickle.UnpicklingError, IndexError)
|
||||
|
||||
def dumps(self, arg, protocol=None):
|
||||
return pickle.dumps(arg, protocol)
|
||||
|
|
@ -119,6 +121,7 @@ class PyChainDispatchTableTests(AbstractDispatchTableTests):
|
|||
if has_c_implementation:
|
||||
class CUnpicklerTests(PyUnpicklerTests):
|
||||
unpickler = _pickle.Unpickler
|
||||
bad_stack_errors = (pickle.UnpicklingError,)
|
||||
|
||||
class CPicklerTests(PyPicklerTests):
|
||||
pickler = _pickle.Pickler
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue