Skip to content

gh-94543: Clarify the mkstemp documentation - #107033

Closed
picnic-sven wants to merge 1 commit into
python:mainfrom
picnic-sven:picnic-sven-gh-94543
Closed

gh-94543: Clarify the mkstemp documentation#107033
picnic-sven wants to merge 1 commit into
python:mainfrom
picnic-sven:picnic-sven-gh-94543

Conversation

@picnic-sven

@picnic-sven picnic-sven commented Jul 22, 2023

Copy link
Copy Markdown
Contributor

Clarify the mkstemp documentation to explicity describe that the file should be closed and removed.

Originally raised in: #94543


📚 Documentation preview 📚: https://cpython-previews--107033.org.readthedocs.build/

Comment thread Doc/library/tempfile.rst
Comment on lines +225 to +227
Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for closing
and deleting the temporary file (by e.g. using :func:`os.close` and
:func:`os.remove`) when done with it.

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 ensure lines are max 79 characters.
  • Please don't use latin abbreviations, see the devguide for more information.

@github-actions

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 13, 2026
Comment thread Doc/library/tempfile.rst

Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible
for deleting the temporary file when done with it.
Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for closing

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.

"for closing the file descriptor and deleting the temporary file"

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Jun 5, 2026
@hugovk

hugovk commented Jul 30, 2026

Copy link
Copy Markdown
Member

Thanks for the PR, closed in favour of #154748 which includes this.

@hugovk hugovk closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

5 participants