Skip to content

Commit 86e4bda

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 777d478 commit 86e4bda

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
@@ -2338,7 +2338,7 @@ features:
23382338

23392339
.. function:: replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
23402340

2341-
Rename the file or directory *src* to *dst*. If *dst* is a directory,
2341+
Rename the file or directory *src* to *dst*. If *dst* is a non-empty directory,
23422342
:exc:`OSError` will be raised. If *dst* exists and is a file, it will
23432343
be replaced silently if the user has permission. The operation may fail
23442344
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
@@ -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)