Skip to content

Commit 161dff7

Browse files
authored
gh-84459: Make wording more specific for Path.replace (GH-91853)
#84459
1 parent c6b84a7 commit 161dff7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doc/library/os.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2348,7 +2348,7 @@ features:
23482348

23492349
.. function:: replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
23502350

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

Doc/library/pathlib.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ call fails (for example because the path doesn't exist).
10421042

10431043
Rename this file or directory to the given *target*, and return a new Path
10441044
instance pointing to *target*. If *target* points to an existing file or
1045-
directory, it will be unconditionally replaced.
1045+
empty directory, it will be unconditionally replaced.
10461046

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

0 commit comments

Comments
 (0)