]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-70363: Implement `io.IOBase` interface for `SpooledTemporaryFile` (GH-29560)
authorCarey Metcalfe <carey@cmetcalfe.ca>
Tue, 3 May 2022 12:18:18 +0000 (08:18 -0400)
committerGitHub <noreply@github.com>
Tue, 3 May 2022 12:18:18 +0000 (21:18 +0900)
commit78e70be3318bc2ca57dac188061ed35017a0867c
tree25e43cb96acdf6eea461548410087dab85b6ebb2
parent52dc9c3066bcdc67a7a45d41cf158ecb1434d5f3
gh-70363: Implement `io.IOBase` interface for `SpooledTemporaryFile` (GH-29560)

Since the underlying file-like objects (either `io.BytesIO`,
or a true file object) all implement the `io.IOBase`
interface, the `SpooledTemporaryFile` should as well.

Additionally, since the underlying file object will either be an
instance of an `io.BufferedIOBase` (for binary mode) or an
`io.TextIOBase` (for text mode), methods for these classes were also
implemented.

In every case, the required methods and properties are simply delegated
to the underlying file object.

Co-authored-by: Gary Fernie <Gary.Fernie@skyscanner.net>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Doc/library/tempfile.rst
Lib/tempfile.py
Lib/test/test_tempfile.py
Misc/ACKS
Misc/NEWS.d/next/Library/2021-11-14-01-35-04.bpo-26175.LNlOfI.rst [new file with mode: 0644]