◐ Shell
clean mode source ↗

Message 310281 - Python tracker

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