diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-06-10 06:59:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 15:59:39 +0200 |
commit | a0c7df09689769f3016dc9145eb56341aac631a9 (patch) | |
tree | 7fb9409bcb5f978e628449c4efd4e52a77bb2154 /Lib/pickle.py | |
parent | 2ad51c636ae44ef847bf8d7ae687f739dfeade41 (diff) | |
download | cpython-git-a0c7df09689769f3016dc9145eb56341aac631a9.tar.gz |
gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) (GH-93632)
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.
(cherry picked from commit a365dd64c2a1f0d142540d5031003f24986f489f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r-- | Lib/pickle.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py index e7f30f2261..f027e04320 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -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): |