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

Skip to content

Commit 32c2274

Browse files
GH-82695: Clarify pathlib.Path.mkdir() documentation (#114032)
Remove a double negative in the documentation of `mkdir()`'s *exist_ok* parameter. Co-authored-by: Adam Turner <[email protected]>
1 parent 3a61d24 commit 32c2274

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
@@ -1306,9 +1306,9 @@ call fails (for example because the path doesn't exist).
13061306
If *exist_ok* is false (the default), :exc:`FileExistsError` is
13071307
raised if the target directory already exists.
13081308

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

13131313
.. versionchanged:: 3.5
13141314
The *exist_ok* parameter was added.

0 commit comments

Comments
 (0)