]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix `PurePath.relative_to` links in the pathlib documentation. (GH-93268)
authorjacksonriley <52106215+jacksonriley@users.noreply.github.com>
Tue, 7 Jun 2022 18:54:16 +0000 (19:54 +0100)
committerGitHub <noreply@github.com>
Tue, 7 Jun 2022 18:54:16 +0000 (11:54 -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`.

Doc/library/pathlib.rst

index e16097d00f60f359d584c28a686c744f83d9c7bf..3b401fbaee839aa782ec6eeb6f3eb1608ab08a77 100644 (file)
@@ -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` 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.