Skip to content

Commit 35a4eb2

Browse files
gh-84459: Make wording more specific for Path.replace (GH-91853)
GH-84459 (cherry picked from commit 161dff7) Co-authored-by: slateny <[email protected]>
1 parent 993bb16 commit 35a4eb2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,7 @@ features:
22072207

22082208
.. function:: replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
22092209

2210-
Rename the file or directory *src* to *dst*. If *dst* is a directory,
2210+
Rename the file or directory *src* to *dst*. If *dst* is a non-empty directory,
22112211
:exc:`OSError` will be raised. If *dst* exists and is a file, it will
22122212
be replaced silently if the user has permission. The operation may fail
22132213
if *src* and *dst* are on different filesystems. If successful,

Doc/library/pathlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ call fails (for example because the path doesn't exist).
10281028

10291029
Rename this file or directory to the given *target*, and return a new Path
10301030
instance pointing to *target*. If *target* points to an existing file or
1031-
directory, it will be unconditionally replaced.
1031+
empty directory, it will be unconditionally replaced.
10321032

10331033
The target path may be absolute or relative. Relative paths are interpreted
10341034
relative to the current working directory, *not* the directory of the Path

0 commit comments

Comments
 (0)