[Python-checkins] [3.10] gh-72073: Add Windows case in pathlib.rename (GH-93002) (GH-93029)

miss-islington webhook-mailer at python.org
Fri May 20 18:44:22 EDT 2022


https://github.com/python/cpython/commit/3c2a1e7f4af3c5c54e04dfe9ac3a68d2351b00fb
commit: 3c2a1e7f4af3c5c54e04dfe9ac3a68d2351b00fb
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-05-20T15:44:07-07:00
summary:

[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 f51ed04c663417f88e10eeb21dad23250358bafa)


Co-authored-by: Stanley <46876382+slateny at users.noreply.github.com>

Automerge-Triggered-By: GH:brettcannon

files:
M Doc/library/pathlib.rst

diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index f036d8119243a..004f671b033ae 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -1018,8 +1018,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, :exc:`FileExistsError` will be raised.
+   *target* can be either a string or another path object::
 
       >>> p = Path('foo')
       >>> p.open('w').write('some text')



More information about the Python-checkins mailing list