Skip to content

gh-84459: Make wording more specific for Path.replace #91853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down