From f97e42ef4d97dee64f45ed65170a6e77c8e46fdf Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Sat, 3 Oct 2020 12:52:13 +0300 Subject: bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554) --- Doc/library/pathlib.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Doc/library/pathlib.rst') diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 23486b6250..9526a03b05 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. -- cgit v1.2.1