[issue41270] NamedTemporaryFile is not its own iterator.

Seth Sims report at bugs.python.org
Fri Jul 10 09:58:42 EDT 2020


New submission from Seth Sims <seth.sims at gmail.com>:

_TemporaryFileWrapper does not proxy __next__ to the underlying file object. There was a discussion on the mailing list in 2016 mentioning this, however it seems it was dropped without a consensus. Biopython encountered this issue (referenced below) and we agree it violates our assumptions about how the NamedTemporaryFile should work. I think it would be fairly trivial to fix by just returning `self.file.readline()`

mailing list thread: https://mail.python.org/pipermail/python-list/2016-July/862590.html

biopython discussion: https://github.com/biopython/biopython/pull/3031

----------
components: Library (Lib)
messages: 373467
nosy: Seth Sims
priority: normal
severity: normal
status: open
title: NamedTemporaryFile is not its own iterator.
type: behavior
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41270>
_______________________________________


More information about the Python-bugs-list mailing list