-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
pathlib's mkdir documentation improvement #82695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There are some inconsistencies in the actual documentation of path lib's mkdir doc. Here is the 3.7 version, annotated and followed by a change proposal Path.mkdir(mode=0o777, parents=False, exist_ok=False)
Create a new directory at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If the path already exists, FileExistsError is raised. <<<<<<<<<<<<<<<<<< NOT ALWAYS due to exist_ok. If parents is true, any missing parents of this path are created as needed; they are created with the default permissions without taking mode into account (mimicking the POSIX mkdir -p command). If parents is false (the default), a missing parent raises FileNotFoundError. If exist_ok is false (the default), FileExistsError is raised if the target directory already exists. If exist_ok is true, 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. <<<<<<<<<<<<<<<<<< UNCLEAR: 1) what is an ignored exception ? 2) The reference to POSIX should appear at the end, like above, 3) the last path component is a string 4) usage of a double negation ignore/is not ----- CHANGE ---- Path.mkdir(mode=0o777, parents=False, exist_ok=False)
Create a new directory in the file system at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If parents is false (the default), a missing parent raises FileNotFoundError. If parents is true, any missing parents of this path are created as needed; they are created with the default permissions without taking mode into account (mimicking the POSIX mkdir -p command). If exist_ok is false (the default), FileExistsError is raised if the given path already exists in the file system, whether a directory or not. If exist_ok is true, FileExistsError is raised only if the given path already exists in the file system and is not a directory (same behavior as the POSIX mkdir -p command). Thanks for reading JL |
Remove a double negative in the documentation of `mkdir()`'s *exist_ok* parameter.
Remove a double negative in the documentation of `mkdir()`'s *exist_ok* parameter. Co-authored-by: Adam Turner <[email protected]>
…H-114032) 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]>
…H-114032) 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]>
) (#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]>
) (#114463) 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]>
Sorted! |
…114032) Remove a double negative in the documentation of `mkdir()`'s *exist_ok* parameter. Co-authored-by: Adam Turner <[email protected]>
…114032) Remove a double negative in the documentation of `mkdir()`'s *exist_ok* parameter. Co-authored-by: Adam Turner <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
pathlib.Path.mkdir()
documentation #114032pathlib.Path.mkdir()
documentation (GH-114032) #114462pathlib.Path.mkdir()
documentation (GH-114032) #114463The text was updated successfully, but these errors were encountered: