mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609)
copy.copy() and copy.deepcopy() now always raise a TypeError if __reduce__() returns a tuple with length 6 instead of silently ignore the 6th item or produce incorrect result.
This commit is contained in:
parent
cffa4f7854
commit
a365dd64c2
4 changed files with 27 additions and 2 deletions
|
|
@ -619,7 +619,7 @@ class _Pickler:
|
|||
"persistent IDs in protocol 0 must be ASCII strings")
|
||||
|
||||
def save_reduce(self, func, args, state=None, listitems=None,
|
||||
dictitems=None, state_setter=None, obj=None):
|
||||
dictitems=None, state_setter=None, *, obj=None):
|
||||
# This API is called by some subclasses
|
||||
|
||||
if not isinstance(args, tuple):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue