]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-50644: Forbid pickling of codecs streams (GH-109180) (GH-109232)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 10 Sep 2023 17:41:19 +0000 (10:41 -0700)
committerGitHub <noreply@github.com>
Sun, 10 Sep 2023 17:41:19 +0000 (17:41 +0000)
commitb070d73ff20df210eb41e3e5104ba6c355d9584e
treec44d9271c15aff1dab742ab44b14a9420313c33d
parentc20658249da47408c2d2455de87d7e70445cf3f0
[3.11] gh-50644: Forbid pickling of codecs streams (GH-109180) (GH-109232)

Attempts to pickle or create a shallow or deep copy of codecs streams
now raise a TypeError.

Previously, copying failed with a RecursionError, while pickling
produced wrong results that eventually caused unpickling to fail with
a RecursionError.
(cherry picked from commit d6892c2b9263b39ea1c7905667942914b6a24b2c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/codecs.py
Lib/test/test_codecs.py
Misc/NEWS.d/next/Library/2023-09-09-15-08-37.gh-issue-50644.JUAZOh.rst [new file with mode: 0644]