]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix `PurePath.relative_to` links in the pathlib documentation. (GH-93268)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Jun 2022 19:11:10 +0000 (12:11 -0700)
committerGitHub <noreply@github.com>
Tue, 7 Jun 2022 19:11:10 +0000 (12:11 -0700)
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>
Doc/library/pathlib.rst

index 7c407242515d272938526f14ef11079eca5f4b4a..5720334b0a26ab25e4b98f3fc9f1377a01bc35d7 100644 (file)
@@ -1284,7 +1284,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`
@@ -1299,4 +1299,4 @@ Below is a table mapping various :mod:`os` functions to their corresponding
 .. rubric:: Footnotes
 
 .. [#] :func:`os.path.abspath` normalizes the resulting path, which may change its meaning in the presence of symlinks, while :meth:`Path.absolute` does not.
-.. [#] :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.