[issue33762] temp file isn't IOBase

2019-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually things are more complex. TemporaryFile is not a class, it is a function, so it does not make sense to use it with isinstance(). And if add support for TemporaryFile, NamedTemporaryFile and SpooledTemporaryFile should be supported too. It may be e

[issue33762] temp file isn't IOBase

2019-12-10 Thread Andrew Svetlov
Andrew Svetlov added the comment: Agree, aiohttp can be fixed easily. If somebody wants to make a pull request -- you are welcome! https://github.com/aio-libs/aiohttp/issues/4432 -- ___ Python tracker _

[issue33762] temp file isn't IOBase

2019-12-10 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.7, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue33762] temp file isn't IOBase

2019-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even if make TemporaryFile a subclass of IOBase (I am not sure we should do this) you could only use this in Python 3.9 and newer. I think it is better to fix this issue on the aiohttp side. aiohttp already registers payload types for a bunch of file-like

[issue33762] temp file isn't IOBase

2019-12-10 Thread Sergii Tkachenko
Sergii Tkachenko added the comment: Affected as well: Python 3.8.0 (default, Nov 3 2019, 10:55:54) [Clang 11.0.0 (clang-1100.0.33.8)] on darwin -- versions: +Python 3.8 -Python 3.7 ___ Python tracker __

[issue33762] temp file isn't IOBase

2019-12-10 Thread Sergii Tkachenko
Sergii Tkachenko added the comment: Confirming this to be a thing on Python 3.7.5 / OS X 10.15.1. In [31]: f = tempfile.NamedTemporaryFile() In [32]: isinstance(f, io.IOBase) Out[32]: False -- nosy: +sergiitk versions: +Python 3.7 -Python 3.6 ___ P

[issue33762] temp file isn't IOBase

2019-06-04 Thread Greg Lindahl
Greg Lindahl added the comment: This is breaking aiohttp client file multipart uploads from temporary files. I'd be willing to bet that a lot of libraries do isinstance(foo, io.IOBase) deep in their guts. -- nosy: +wumpus ___ Python tracker

[issue33762] temp file isn't IOBase

2018-06-09 Thread Martin Panter
Martin Panter added the comment: I think it is an implementation detail whether the result subclasses IOBase or just implements its API. Why do you want to check the base class, and why IOBase in particular, rather than BufferedIOBase, RawIOBase, or TextIOBase? -- __

[issue33762] temp file isn't IOBase

2018-06-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: Martin, I added you because this Tempfile issue is related to #26175. -- nosy: +martin.panter, terry.reedy ___ Python tracker ___ ___

[issue33762] temp file isn't IOBase

2018-06-03 Thread Dutcho
New submission from Dutcho : 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._TemporaryFileWra