New submission from Dutcho <dut...@ziggo.nl>:

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

----------
components: Library (Lib)
messages: 318585
nosy: Dutcho
priority: normal
severity: normal
status: open
title: temp file isn't IOBase
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33762>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to