Skip to content

Commit fc972fa

Browse files
miss-islingtonsirosenpicnic-sven
authored
[3.13] gh-94543: Improve tempfile.mkstemp documentation about cleanup (GH-154748) (#154962)
Co-authored-by: Stephen Rosen <sirosen0@gmail.com> Co-authored-by: picnic-sven <88426829+picnic-sven@users.noreply.github.com>
1 parent c52fb03 commit fc972fa

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/tempfile.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ The module defines the following user-callable items:
230230
The file descriptor is :ref:`not inherited by child processes <fd_inheritance>`.
231231

232232
Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible
233-
for deleting the temporary file when done with it.
233+
for closing the file descriptor (for example, using :func:`os.close`) and
234+
deleting the temporary file (for example, using :func:`os.remove`).
234235

235236
If *suffix* is not ``None``, the file name will end with that suffix,
236237
otherwise there will be no suffix. :func:`mkstemp` does not put a dot

0 commit comments

Comments
 (0)