Skip to content

gh-152586: Make tempfile.TemporaryFileWrapper public#152646

Open
Aniketsy wants to merge 2 commits into
python:mainfrom
Aniketsy:fix-152586
Open

gh-152586: Make tempfile.TemporaryFileWrapper public#152646
Aniketsy wants to merge 2 commits into
python:mainfrom
Aniketsy:fix-152586

Conversation

@Aniketsy

@Aniketsy Aniketsy commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@read-the-docs-community

read-the-docs-community Bot commented Jun 30, 2026

Copy link
Copy Markdown

Comment thread Doc/library/tempfile.rst Outdated
Comment thread Lib/test/test_tempfile.py
self.assertIn("TemporaryFileWrapper", tempfile.__all__)

def test_is_return_type_of_named_temporary_file(self):
with tempfile.NamedTemporaryFile() as f:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I propose to move this check to any existing test above.

Comment thread Lib/tempfile.py
for line in self.file:
yield line

_TemporaryFileWrapper = TemporaryFileWrapper

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please, add a comment: why it is there.
Question: does it make sence to deprecate the older alias at the same time?

@Aniketsy Aniketsy Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please, add a comment: why it is there.

sure 👍

Question: does it make sence to deprecate the older alias at the same time?

I think we can deprecate in follow up, but if you prefer we should add in this PR, only-- i'm happy to go with

Thanks for the review!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would deprecate it right away :)

Co-authored-by: sobolevn <mail@sobolevn.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make tempfile._TemporaryFileWrapper public

2 participants