Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2b87921

Browse files
committed
Issue #27180: Clarify Path.rename() behavior on Unix systems
Patch by Evelyn Mitchell.
1 parent 3093bf1 commit 2b87921

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/library/pathlib.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,9 @@ call fails (for example because the path doesn't exist):
891891

892892
.. method:: Path.rename(target)
893893

894-
Rename this file or directory to the given *target*. *target* can be
895-
either a string or another path object::
894+
Rename this file or directory to the given *target*. On Unix, if
895+
*target* exists and is a file, it will be replaced silently if the user
896+
has permission. *target* can be either a string or another path object::
896897

897898
>>> p = Path('foo')
898899
>>> p.open('w').write('some text')

0 commit comments

Comments
 (0)