From 6c3a0bc3f66f859900fa3b35fb4f750894cfda0f Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sat, 23 Apr 2022 00:46:31 -0700 Subject: [PATCH 1/2] Made wording more specific for Path.replace --- Doc/library/pathlib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 1e7bc315471e2c..01e9cfb93e3911 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 From 21e5ff4157cd55e7a629b37497d1d5b4c2061299 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Wed, 27 Apr 2022 00:46:28 -0700 Subject: [PATCH 2/2] Change also os.replace wording --- Doc/library/os.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 254d6e192cdf08..ff5396d2b8ded7 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -2348,7 +2348,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,