]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-72073: Add Windows case in pathlib.rename (GH-93002)
authorStanley <46876382+slateny@users.noreply.github.com>
Fri, 20 May 2022 22:25:39 +0000 (15:25 -0700)
committerGitHub <noreply@github.com>
Fri, 20 May 2022 22:25:39 +0000 (15:25 -0700)
#72073

https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.rename

Doc/library/pathlib.rst

index d45e7aa84b28ce013fbd1b61781614c76d763e29..cda2cc83225e07278f0032faf58c0f671da0c3cd 100644 (file)
@@ -1021,8 +1021,9 @@ 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*.  On Unix, if *target* exists and is a file,
-   it will be replaced silently if the user has permission.  *target* can be
-   either a string or another path object::
+   it will be replaced silently if the user has permission.
+   On Windows, if *target* exists, :data:`FileExistsError` will be raised.
+   *target* can be either a string or another path object::
 
       >>> p = Path('foo')
       >>> p.open('w').write('some text')