[Python-checkins] gh-84459: Make wording more specific for Path.replace (GH-91853)
miss-islington
webhook-mailer at python.org
Wed Apr 27 18:18:12 EDT 2022
https://github.com/python/cpython/commit/86e4bdaf493d3d5e0ded31d170eafd2a15a57f8f
commit: 86e4bdaf493d3d5e0ded31d170eafd2a15a57f8f
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-04-27T15:18:06-07:00
summary:
gh-84459: Make wording more specific for Path.replace (GH-91853)
GH-84459
(cherry picked from commit 161dff7e10eeb7eaf6d418b91e993aaf84770a5c)
Co-authored-by: slateny <46876382+slateny at users.noreply.github.com>
files:
M Doc/library/os.rst
M Doc/library/pathlib.rst
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index dbd3c968dd35a..b81574b7eaa46 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -2338,7 +2338,7 @@ features:
.. function:: replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
- Rename the file or directory *src* to *dst*. If *dst* is a directory,
+ Rename the file or directory *src* to *dst*. If *dst* is a non-empty directory,
:exc:`OSError` will be raised. If *dst* exists and is a file, it will
be replaced silently if the user has permission. The operation may fail
if *src* and *dst* are on different filesystems. If successful,
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index fedea34bcd0c4..f036d8119243a 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -1042,7 +1042,7 @@ call fails (for example because the path doesn't exist).
Rename this file or directory to the given *target*, and return a new Path
instance pointing to *target*. If *target* points to an existing file or
- directory, it will be unconditionally replaced.
+ empty directory, it will be unconditionally replaced.
The target path may be absolute or relative. Relative paths are interpreted
relative to the current working directory, *not* the directory of the Path
More information about the Python-checkins
mailing list