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

Skip to content

Commit 3c2a1e7

Browse files
[3.10] gh-72073: Add Windows case in pathlib.rename (GH-93002) (GH-93029)
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 4d363d8 commit 3c2a1e7

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
@@ -1018,8 +1018,9 @@ call fails (for example because the path doesn't exist).
10181018

10191019
Rename this file or directory to the given *target*, and return a new Path
10201020
instance pointing to *target*. On Unix, if *target* exists and is a file,
1021-
it will be replaced silently if the user has permission. *target* can be
1022-
either a string or another path object::
1021+
it will be replaced silently if the user has permission.
1022+
On Windows, if *target* exists, :exc:`FileExistsError` will be raised.
1023+
*target* can be either a string or another path object::
10231024

10241025
>>> p = Path('foo')
10251026
>>> p.open('w').write('some text')

0 commit comments

Comments
 (0)
0