Skip to content

bpo-41270: Making NamedTemporaryFile act as its own iterator to mimic…#22766

Open
xzy3 wants to merge 2 commits into
python:mainfrom
xzy3:namedtemporaryfile-next
Open

bpo-41270: Making NamedTemporaryFile act as its own iterator to mimic…#22766
xzy3 wants to merge 2 commits into
python:mainfrom
xzy3:namedtemporaryfile-next

Conversation

@xzy3
Copy link
Copy Markdown

@xzy3 xzy3 commented Oct 19, 2020

… normal file objects.

NamedTemporaryFile returns a proxy object _TemporaryFileWrapper. However it does not proxy
the __next__ method so the object cannot be used by for loops or by the next() builtin
without calling iter() on it first. This changes that by explicitly poxying the __next__
method.

https://bugs.python.org/issue41270

… normal file objects.

NamedTemporaryFile returns a proxy object _TemporaryFileWrapper. However it does not proxy
the __next__ method so the object cannot be used by for loops or by the next() builtin
without calling iter() on it first. This changes that by explicity poxying the __next__
method.
Copy link
Copy Markdown
Contributor

@jstasiak jstasiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread Lib/test/test_tempfile.py Outdated
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Dec 16, 2020
@xzy3
Copy link
Copy Markdown
Author

xzy3 commented Dec 18, 2020

@jstasiak this has been sitting for a while. Is there any update?

@jstasiak
Copy link
Copy Markdown
Contributor

@xzy3 I'm dorry, I'm not a core dev, I can't do anything other than reviewing this.

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Dec 19, 2020
@peterjc
Copy link
Copy Markdown

peterjc commented Apr 11, 2022

Following the issue migration to GitHub, this PR would close #85442.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants