[Python-checkins] [3.11] gh-51574: Document behaviour of `mkdtemp` on 3.11 and lower (#103844)

JelleZijlstra webhook-mailer at python.org
Thu Apr 27 10:57:02 EDT 2023


https://github.com/python/cpython/commit/d20758c4ef74aa85219b85e18259e86575e52966
commit: d20758c4ef74aa85219b85e18259e86575e52966
branch: 3.11
author: Alex Waygood <Alex.Waygood at Gmail.com>
committer: JelleZijlstra <jelle.zijlstra at gmail.com>
date: 2023-04-27T07:56:55-07:00
summary:

[3.11] gh-51574: Document behaviour of `mkdtemp` on 3.11 and lower (#103844)

files:
M Doc/library/tempfile.rst

diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
index b7e604c1b70a..c17ead1510e7 100644
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -226,7 +226,10 @@ The module defines the following user-callable items:
    The *prefix*, *suffix*, and *dir* arguments are the same as for
    :func:`mkstemp`.
 
-   :func:`mkdtemp` returns the absolute pathname of the new directory.
+   :func:`mkdtemp` returns the absolute pathname of the new directory if *dir*
+   is ``None`` or is an absolute path. If *dir* is a relative path,
+   :func:`mkdtemp` returns a relative path on Python 3.11 and lower. However,
+   on 3.12 it will return an absolute path in all situations.
 
    .. audit-event:: tempfile.mkdtemp fullpath tempfile.mkdtemp
 



More information about the Python-checkins mailing list