From: jacksonriley <52106215+jacksonriley@users.noreply.github.com> Date: Tue, 7 Jun 2022 21:58:43 +0000 (+0100) Subject: [3.10] Fix `PurePath.relative_to` links in the pathlib documentation (GH-93268) ... X-Git-Tag: v3.10.6~188 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b9122483f1f26afb0c41bd676f9754ffe726e18;p=thirdparty%2FPython%2Fcpython.git [3.10] Fix `PurePath.relative_to` links in the pathlib documentation (GH-93268) (GH-93590) These are currently broken as they refer to :meth:`Path.relative_to` rather than :meth:`PurePath.relative_to`, and `relative_to` is a method on `PurePath`.. (cherry picked from commit 8ef7929baffd0038bcb38978a6a91ecc63bf0de2) Co-authored-by: jacksonriley <52106215+jacksonriley@users.noreply.github.com> Backport of #93268 --- diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 004f671b033a..8077796ff6f6 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1265,7 +1265,7 @@ Below is a table mapping various :mod:`os` functions to their corresponding :func:`os.link` :meth:`Path.hardlink_to` :func:`os.symlink` :meth:`Path.symlink_to` :func:`os.readlink` :meth:`Path.readlink` -:func:`os.path.relpath` :meth:`Path.relative_to` [#]_ +:func:`os.path.relpath` :meth:`PurePath.relative_to` [#]_ :func:`os.stat` :meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group` @@ -1280,4 +1280,4 @@ Below is a table mapping various :mod:`os` functions to their corresponding .. rubric:: Footnotes .. [#] :func:`os.path.abspath` does not resolve symbolic links while :meth:`Path.resolve` does. -.. [#] :meth:`Path.relative_to` requires ``self`` to be the subpath of the argument, but :func:`os.path.relpath` does not. +.. [#] :meth:`PurePath.relative_to` requires ``self`` to be the subpath of the argument, but :func:`os.path.relpath` does not.