This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: NamedTemporaryFile is not its own iterator.
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, maubp, pitrou, python-dev, serhiy.storchaka, tontinton, xzy3
Priority: normal Keywords: patch

Created on 2020-07-10 13:58 by xzy3, last changed 2022-04-11 14:59 by admin.

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 (2)
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
msg407372 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-11-30 13:15
Biopython uses next() without iter(), and there is no guarantee that it should work.
History
Date User Action Args
2022-04-11 14:59:33adminsetgithub: 85442
2021-11-30 13:15:38serhiy.storchakasetnosy: + serhiy.storchaka, pitrou, brett.cannon
messages: + msg407372
2021-11-30 12:43:18iritkatrielsettype: behavior -> enhancement
versions: + Python 3.11, - Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9, Python 3.10
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