classification
Title: NamedTemporaryFile is not its own iterator.
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7, Python 3.6, Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: maubp, python-dev, tontinton, xzy3
Priority: normal Keywords: patch

Created on 2020-07-10 13:58 by xzy3, last changed 2020-10-19 12:28 by xzy3.

Pull Requests
URL Status Linked Edit
PR 21434 closed python-dev, 2020-07-10 14:00
PR 21439 closed tontinton, 2020-07-10 21:33
PR 21442 merged tontinton, 2020-07-11 09:09
PR 22766 open xzy3, 2020-10-19 12:28
Messages (1)
msg373467 - (view) Author: Seth Sims (xzy3) * Date: 2020-07-10 13:58
_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
History
Date User Action Args
2020-10-19 12:28:46xzy3setpull_requests: + pull_request21728
2020-07-11 09:09:17tontintonsetpull_requests: + pull_request20590
2020-07-10 21:33:36tontintonsetnosy: + tontinton
pull_requests: + pull_request20585
2020-07-10 18:00:46maubpsetnosy: + maubp
2020-07-10 14:00:53python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request20581
stage: patch review
2020-07-10 13:58:42xzy3create