diff options
author | 2022-05-20 15:42:28 -0700 | |
---|---|---|
committer | 2022-05-20 15:42:28 -0700 | |
commit | 61dfe37429d29e704acb024655e450de5d1649d5 (patch) | |
tree | bf8668ee338e03b6290519717632e702ce16273b | |
parent | gh-92611: Clarify planned removal version in PEP 594-deprecated modules (GH-9... (diff) | |
download | cpython-61dfe37429d29e704acb024655e450de5d1649d5.tar.gz cpython-61dfe37429d29e704acb024655e450de5d1649d5.tar.bz2 cpython-61dfe37429d29e704acb024655e450de5d1649d5.zip |
[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 f51ed04c663417f88e10eeb21dad23250358bafa)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Automerge-Triggered-By: GH:brettcannon
-rw-r--r-- | Doc/library/pathlib.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index ab26e2f1719..7c407242515 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, :exc:`FileExistsError` will be raised. + *target* can be either a string or another path object:: >>> p = Path('foo') >>> p.open('w').write('some text') |