From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 23 Jan 2024 02:37:55 +0000 (+0100) Subject: [3.11] GH-82695: Clarify `pathlib.Path.mkdir()` documentation (GH-114032) (#114463) X-Git-Tag: v3.11.8~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d2ad6f24a0801d58ab47c5d07907adf260a3436;p=thirdparty%2FPython%2Fcpython.git [3.11] GH-82695: Clarify `pathlib.Path.mkdir()` documentation (GH-114032) (#114463) Remove a double negative in the documentation of `mkdir()`'s *exist_ok* parameter. (cherry picked from commit 32c227470aa6f72950b76206ffc529c258b4b8fa) Co-authored-by: Barney Gale Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 283e324a7f1b..528236cfa7ea 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -994,9 +994,9 @@ call fails (for example because the path doesn't exist). If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if the target directory already exists. - If *exist_ok* is true, :exc:`FileExistsError` exceptions will be - ignored (same behavior as the POSIX ``mkdir -p`` command), but only if the - last path component is not an existing non-directory file. + If *exist_ok* is true, :exc:`FileExistsError` will not be raised unless the given + path already exists in the file system and is not a directory (same + behavior as the POSIX ``mkdir -p`` command). .. versionchanged:: 3.5 The *exist_ok* parameter was added.