bpo-26175: Fix SpooledTemporaryFile IOBase abstract by GFernie · Pull Request #3249 · python/cpython

@GFernie

One would assume that this class implements the IOBase abstract. As the
underlying file-like object is either io.BytesIO, io.StringIO, or a true
file object, this is a reasonable abstract expect and to implement.

Regardless, the behaviour of this class does not change much in the case
of the attribute being missing from the underlying file-like; an
AttributeError is still raised, albeit from one additional frame on the
stack trace.

@GFernie

merwok

pppery

@GFernie

We don't want to delete the underlying file explicitly as the expected
behaviour is for the file to be deleted *after* it falls out of scope.

@GFernie

thehesiod

@btel btel mentioned this pull request

Dec 11, 2020

@pR0Ps pR0Ps mentioned this pull request

Nov 15, 2021

@GFernie GFernie mannequin mentioned this pull request

May 3, 2022

This was referenced

Jan 9, 2026