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.

Author Dutcho
Recipients Dutcho
Date 2018-06-03.20:53:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1528059185.23.0.592728768989.issue33762@psf.upfronthosting.co.za>
In-reply-to
Content
I'd expect isinstance(tempfile.TemporaryFile(), io.IOBase) to be True as you can read() from and write() to the temp file.

However, on Python 3.6.5 64 bit on Windows 7 above isinstance() == False and and type(tempfile.TemporaryFile()) == tempfile._TemporaryFileWrapper, which has no super class (other than object).
Whereas, on Python 3.6.1 on iOS 11.4 (Pythonista 3.2) above isinstance() == True and type(tempfile.TemporaryFile()) == io.BufferedRandom, which has io.IOBase as its (indirect) super class.
The difference is likely caused by tempfile line 565 that equals TemporaryFile = NamedTemporaryFile in case of Windows.

This may be somewhat related to issue 26175, but isn't a duplicate as 26175 is on a temp file's attributes, and this issue is on its type
History
Date User Action Args
2018-06-03 20:53:05Dutchosetrecipients: + Dutcho
2018-06-03 20:53:05Dutchosetmessageid: <1528059185.23.0.592728768989.issue33762@psf.upfronthosting.co.za>
2018-06-03 20:53:05Dutcholinkissue33762 messages
2018-06-03 20:53:05Dutchocreate