]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-51574: Document behaviour of `mkdtemp` on 3.11 and lower (#103844)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Thu, 27 Apr 2023 14:56:55 +0000 (08:56 -0600)
committerGitHub <noreply@github.com>
Thu, 27 Apr 2023 14:56:55 +0000 (07:56 -0700)
Doc/library/tempfile.rst

index b7e604c1b70acb3f8b70a2cc1a1311899de19993..c17ead1510e7ef76e65a26bb90f38c8441780255 100644 (file)
@@ -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