From: Stephen Rosen Date: Thu, 30 Jul 2026 20:42:32 +0000 (-0500) Subject: gh-94543: Improve tempfile.mkstemp documentation about cleanup (#154748) X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=60b9cf84117567c5df63482d9fbf68db3d7ef74e;p=thirdparty%2FPython%2Fcpython.git gh-94543: Improve tempfile.mkstemp documentation about cleanup (#154748) Co-authored-by: picnic-sven <88426829+picnic-sven@users.noreply.github.com> --- diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index 8c387853d041..9b89cb92594e 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -257,7 +257,8 @@ The module defines the following user-callable items: The file descriptor is :ref:`not inherited by child processes `. 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