]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-84459: Make wording more specific for Path.replace (GH-91853)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 27 Apr 2022 22:20:53 +0000 (15:20 -0700)
committerGitHub <noreply@github.com>
Wed, 27 Apr 2022 22:20:53 +0000 (15:20 -0700)
GH-84459
(cherry picked from commit 161dff7e10eeb7eaf6d418b91e993aaf84770a5c)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
Doc/library/os.rst
Doc/library/pathlib.rst

index 8e553d404100fc27e9fc95bf2db727cba2e676df..f8985a1f3ab9dc112e90f16019aaf74aeb92c233 100644 (file)
@@ -2207,7 +2207,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 3a41b5454b86448b2c12d3bb44f275698167890d..30611abcb945039f7e07e82daf438b5b6ee38a48 100644 (file)
@@ -1028,7 +1028,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