8000 [3.11] gh-72073: Add Windows case in pathlib.rename (GH-93002) (GH-93… · python/cpython@61dfe37 · GitHub
[go: up one dir, main page]

Skip to content

Commit 61dfe37

Browse files
[3.11] gh-72073: Add Windows case in pathlib.rename (GH-93002) (GH-93028)
GH-72073 https://docs.python.org/3.12/library/pathlib.htmlGH-pathlib.Path.rename (cherry picked from commit f51ed04) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com> Automerge-Triggered-By: GH:brettcannon
1 parent 24223ec commit 61dfe37

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/pathlib.rst

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

10221022
Rename this file or directory to the given *target*, and return a new Path
10231023
instance pointing to *target*. On Unix, if *target* exists and is a file,
1024-
it will be replaced silently if the user has permission. *target* can be
1025-
either a string or another path object::
1024+
it will be replaced silently if the user has permission.
1025+
On Windows, if *target* exists, :exc:`FileExistsError` will be raised.
1026+
*target* can be either a string or another path object::
10261027

10271028
>>> p = Path('foo')
10281029
>>> p.open('w').write('some text')

0 commit comments

Comments
 (0)
0