diff options
author | Ram Rachum <ram@rachum.com> | 2020-10-03 09:52:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-03 09:52:13 (GMT) |
commit | f97e42ef4d97dee64f45ed65170a6e77c8e46fdf (patch) | |
tree | 8f7c47df186dc3645170ed9bbbac21d4b93aaedb /Doc | |
parent | 6a412c94b6b68e7e3632562dc7358a12ffd1447f (diff) | |
download | cpython-f97e42ef4d97dee64f45ed65170a6e77c8e46fdf.zip cpython-f97e42ef4d97dee64f45ed65170a6e77c8e46fdf.tar.gz cpython-f97e42ef4d97dee64f45ed65170a6e77c8e46fdf.tar.bz2 |
bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/pathlib.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 23486b6..9526a03 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1008,6 +1008,10 @@ call fails (for example because the path doesn't exist). >>> target.open().read() 'some text' + The target path may be absolute or relative. Relative paths are interpreted + relative to the current working directory, *not* the directory of the Path + object. + .. versionchanged:: 3.8 Added return value, return the new Path instance. @@ -1018,6 +1022,10 @@ call fails (for example because the path doesn't exist). instance pointing to *target*. If *target* points to an existing file or directory, it will be unconditionally replaced. + The target path may be absolute or relative. Relative paths are interpreted + relative to the current working directory, *not* the directory of the Path + object. + .. versionchanged:: 3.8 Added return value, return the new Path instance. |