Message318585
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 |
|
Date |
User |
Action |
Args |
2018-06-03 20:53:05 | Dutcho | set | recipients:
+ Dutcho |
2018-06-03 20:53:05 | Dutcho | set | messageid: <1528059185.23.0.592728768989.issue33762@psf.upfronthosting.co.za> |
2018-06-03 20:53:05 | Dutcho | link | issue33762 messages |
2018-06-03 20:53:05 | Dutcho | create | |
|