From cfb41ec5b53ba3c2fd52f0c0d24b78b4b19b02e6 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Sat, 15 Oct 2022 20:31:18 -0500 Subject: [PATCH 1/3] Whatsnew: Add io method support for tempfile.SpooledTemporaryFile --- Doc/whatsnew/3.11.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 56a35f4e4802ba..56c851bb3c90ad 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -906,6 +906,18 @@ sysconfig (Contributed by Miro HronĨok in :issue:`45413`.) +.. _whatsnew311-tempfile: + +tempfile +-------- + +* :class:`~tempfile.SpooledTemporaryFile` now fully implements the methods + of the :class:`io.BufferedIOBase`/:class:`io.TextIOBase` base classes. + This lets them work correctly with APIs that expect file-like objects, + such as compression modules. + (Contributed by Carey Metcalfe in :gh:`70363`.) + + threading --------- From 6d5a49ad2908a2173cbb3d872c7dccb69c2a3fa1 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Sun, 16 Oct 2022 13:42:38 -0500 Subject: [PATCH 2/3] =?UTF-8?q?Revise=20tempfile=20wording=20for=20clarity?= =?UTF-8?q?=20per=20=C3=89ric's=20suggestion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Doc/whatsnew/3.11.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 56c851bb3c90ad..c33c22da8dadf6 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -912,7 +912,8 @@ tempfile -------- * :class:`~tempfile.SpooledTemporaryFile` now fully implements the methods - of the :class:`io.BufferedIOBase`/:class:`io.TextIOBase` base classes. + of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` + (depending on file mode). This lets them work correctly with APIs that expect file-like objects, such as compression modules. (Contributed by Carey Metcalfe in :gh:`70363`.) From 77d381b5b56166b3d84e8790f76da79a1861d059 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 24 Oct 2022 05:56:24 -0700 Subject: [PATCH 3/3] Update Doc/whatsnew/3.11.rst --- Doc/whatsnew/3.11.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index c33c22da8dadf6..6cc8a32af9cbe1 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -911,7 +911,7 @@ sysconfig tempfile -------- -* :class:`~tempfile.SpooledTemporaryFile` now fully implements the methods +* :class:`~tempfile.SpooledTemporaryFile` objects now fully implements the methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending on file mode). This lets them work correctly with APIs that expect file-like objects,