[3.9] bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554)
(cherry picked from commit f97e42ef4d97dee64f45ed65170a6e77c8e46fdf)
Co-authored-by: Ram Rachum <ram@rachum.com>
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 @@
>>> 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 @@
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.