]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-84459: Make wording more specific for Path.replace (GH-91853)
authorslateny <46876382+slateny@users.noreply.github.com>
Wed, 27 Apr 2022 22:03:03 +0000 (15:03 -0700)
committerGitHub <noreply@github.com>
Wed, 27 Apr 2022 22:03:03 +0000 (15:03 -0700)
#84459

Doc/library/os.rst
Doc/library/pathlib.rst

index 471890e74c8e5812f8742664bac27d78b499382b..d42259b2548f6cba69e8c2c9933d376270e97820 100644 (file)
@@ -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,
index 1e7bc315471e2c6a5a30279a2d697b6ba916c985..01e9cfb93e391127d8881a02f277b7191242ec82 100644 (file)
@@ -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