Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Open
xzy3 wants to merge 2 commits into
python:mainpython/cpython:mainfrom
xzy3:namedtemporaryfile-nextxzy3/cpython:namedtemporaryfile-nextCopy head branch name to clipboard
Open

bpo-41270: Making NamedTemporaryFile act as its own iterator to mimic…#22766
xzy3 wants to merge 2 commits into
python:mainpython/cpython:mainfrom
xzy3:namedtemporaryfile-nextxzy3/cpython:namedtemporaryfile-nextCopy head branch name to clipboard

Conversation

@xzy3

@xzy3 xzy3 commented Oct 19, 2020

Copy link
Copy Markdown

… 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.

@jstasiak jstasiak left a comment

Copy link
Copy Markdown
Contributor

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

xzy3 commented Dec 18, 2020

Copy link
Copy Markdown
Author

@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

peterjc commented Apr 11, 2022

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.