TypeError: '_TemporaryFileWrapper' object is not an iterator

dieter dieter at handshake.de
Sat Jul 30 03:36:00 EDT 2016


Terry Reedy <tjreedy at udel.edu> writes:
> ...
>> The problem seems to come from my expectation that a file
>> is its own iterator and in python3 that is no longer true
>> for a NamedTemporaryFile.
> ...
>> Should this be considered a bug?
>
> No.  The doc for NamedTemporaryFile does not even claim that the
> return is iterable.

I think, it should: the name suggests that "NamedTemporaryFile" is
a "File" and therefore should behave like one.




More information about the Python-list mailing list