X Tutup
The Wayback Machine - https://web.archive.org/web/20250613014634/https://github.com/python/cpython/pull/95485
Skip to content

gh-95484: Improve tempfile docs for conditions when files are removed #95485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NickCrews
Copy link
Contributor

@NickCrews NickCrews commented Jul 30, 2022

Lightly edit some prose. On my initial read of the docs, I was confused about when tempfiles are deleted. I think this PR would have helped me.

Now there are two paragraphs, the first one has to do with "creating a tempfile" and the second is "deleting a tempfile". I think this is a better way of organizing things than what it used to be.

Before, an entire paragraph was about "using as a context manager", which I think is less important than "when is a tempfile deleted". The first paragraph was "what happens when you make a tempfile and also here is one way of when it is closed"

@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Jul 30, 2022
@NickCrews
Copy link
Contributor Author

The bullet list doesn't render properly, I'm actually cloning locally to debug, will push a fix soon...

@NickCrews NickCrews force-pushed the tempfile-docs branch 2 times, most recently from d04a736 to a24a9da Compare July 31, 2022 00:20
@NickCrews
Copy link
Contributor Author

OK, rendering is fixed, it now looks like
image

:ref:`tempfile-examples`). On completion of the context or
destruction of the file object the temporary file will be removed
from the filesystem.
The temporary file will be removed from the filesystem when the returned
Copy link
Member

Choose a reason for hiding this comment

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

This sentence is not quite grammatical. I'd suggest starting with "The temporary file will be removed from the file system under the following conditions:"

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.

3 participants
X Tutup