We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93b27e7 commit ae87291Copy full SHA for ae87291
2 files changed
Lib/pickle.py
@@ -1724,6 +1724,8 @@ def load_reduce(self):
1724
stack = self.stack
1725
args = stack.pop()
1726
func = stack[-1]
1727
+ if not isinstance(args, tuple):
1728
+ raise TypeError("argument list must be a tuple")
1729
stack[-1] = func(*args)
1730
dispatch[REDUCE[0]] = load_reduce
1731
Lib/test/pickletester.py
@@ -1435,6 +1435,7 @@ def test_bad_reduce(self):
1435
self.assertEqual(self.loads(b'cbuiltins\nint\n)R.'), 0)
1436
self.check_unpickling_error(TypeError, b'N)R.')
1437
self.check_unpickling_error(TypeError, b'cbuiltins\nint\nNR.')
1438
+ self.check_unpickling_error(TypeError, b'cbuiltins\nint\nNR.')
1439
1440
def test_bad_newobj(self):
1441
error = (pickle.UnpicklingError, TypeError)
0 commit comments