Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c2db57

Browse files
miss-islingtonbarneygaleAA-Turner
authored
[3.12] GH-82695: Clarify pathlib.Path.mkdir() documentation (GH-114032) (#114462)
Remove a double negative in the documentation of `mkdir()`'s *exist_ok* parameter. (cherry picked from commit 32c2274) Co-authored-by: Barney Gale <[email protected]> Co-authored-by: Adam Turner <[email protected]>
1 parent a199ab3 commit 9c2db57

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/pathlib.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,9 +1184,9 @@ call fails (for example because the path doesn't exist).
11841184
If *exist_ok* is false (the default), :exc:`FileExistsError` is
11851185
raised if the target directory already exists.
11861186

1187-
If *exist_ok* is true, :exc:`FileExistsError` exceptions will be
1188-
ignored (same behavior as the POSIX ``mkdir -p`` command), but only if the
1189-
last path component is not an existing non-directory file.
1187+
If *exist_ok* is true, :exc:`FileExistsError` will not be raised unless the given
1188+
path already exists in the file system and is not a directory (same
1189+
behavior as the POSIX ``mkdir -p`` command).
11901190

11911191
.. versionchanged:: 3.5
11921192
The *exist_ok* parameter was added.

0 commit comments

Comments
 (0)