This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SpooledTemporaryFile should implement IOBase
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Fully implement IOBase abstract on SpooledTemporaryFile
View: 26175
Assigned To: Nosy List: dutchmo, martin.panter
Priority: normal Keywords:

Created on 2018-01-19 18:31 by dutchmo, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg310281 - (view) Author: Greg Matous (dutchmo) Date: 2018-01-19 18:31
SpooledTemporaryFile returns alternately a buffer or a TemporaryFile().

In either case it should behave like a file-thing.
However it doesn't implement certain properties in IOBase like readable, seekable which seems like should be available.

for example, on Ubuntu Linux with Python 3.6.2, 

reader = csv.reader(TextIOWrapper(csvfile), *args, **kwargs)

gives error AttributeError: 'SpooledTemporaryFile' object has no attribute 'readable'
when csvfile is a werkzeug.datastructures.FileStorage object

see also:
https://stackoverflow.com/questions/47160211/why-doesnt-tempfile-spooledtemporaryfile-implement-readable-writable-seekable
msg310290 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2018-01-19 21:45
There is apparently some work done on this already in Issue 26175.
History
Date User Action Args
2022-04-11 14:58:56adminsetgithub: 76781
2018-01-19 21:45:34martin.pantersetstatus: open -> closed

superseder: Fully implement IOBase abstract on SpooledTemporaryFile

nosy: + martin.panter
messages: + msg310290
resolution: duplicate
stage: resolved
2018-01-19 18:31:53dutchmocreate