summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanley <46876382+slateny@users.noreply.github.com>2022-05-20 22:25:39 (GMT)
committerGitHub <noreply@github.com>2022-05-20 22:25:39 (GMT)
commitf51ed04c663417f88e10eeb21dad23250358bafa (patch)
tree8237126053fca5b9cf8bf35983abcb20b4b4c5b1
parent31fa41ed689528505c0e0cf25777773b7e81c834 (diff)
downloadcpython-f51ed04c663417f88e10eeb21dad23250358bafa.zip
cpython-f51ed04c663417f88e10eeb21dad23250358bafa.tar.gz
cpython-f51ed04c663417f88e10eeb21dad23250358bafa.tar.bz2
gh-72073: Add Windows case in pathlib.rename (GH-93002)
#72073 https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.rename
-rw-r--r--Doc/library/pathlib.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index d45e7aa..cda2cc8 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -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')