]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) (GH-93631)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 10 Jun 2022 14:00:19 +0000 (07:00 -0700)
committerGitHub <noreply@github.com>
Fri, 10 Jun 2022 14:00:19 +0000 (16:00 +0200)
commitc3045d809c284a2eb6b54b21ee88b56281cf8378
tree811fd27095783401663dccfd82363fd8d98c25b7
parent516d90eb215315a120e0a7168db68540321bb478
gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) (GH-93631)

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>
Lib/copy.py
Lib/pickle.py
Lib/test/test_copy.py
Misc/NEWS.d/next/Library/2022-06-08-20-11-02.gh-issue-90494.LIZT85.rst [new file with mode: 0644]