[3.15] gh-94543: Improve tempfile.mkstemp documentation about cleanup (GH-154748) (#154964)

hugovk <[email protected]> Thu, 30 Jul 2026 16:51:19 -0400 (EDT)
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/485c62411d69f6a8c2b39803df654bcdb30502a7
commit: 485c62411d69f6a8c2b39803df654bcdb30502a7
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-07-30T20:51:09Z
summary:

[3.15] gh-94543: Improve tempfile.mkstemp documentation about cleanup (GH-154748) (#154964)

Co-authored-by: Stephen Rosen <[email protected]>
Co-authored-by: picnic-sven <[email protected]>

files:
M Doc/library/tempfile.rst

diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
index bf9198e175a0e1..2009bd012946a2 100644
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -228,7 +228,8 @@ The module defines the following user-callable items:
    The file descriptor is :ref:`not inherited by child processes <fd_inheritance>`.
 
    Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible
-   for deleting the temporary file when done with it.
+   for closing the file descriptor (for example, using :func:`os.close`) and
+   deleting the temporary file (for example, using :func:`os.remove`).
 
    If *suffix* is not ``None``, the file name will end with that suffix,
    otherwise there will be no suffix.  :func:`mkstemp` does not put a dot

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]