Skip to content

Commit f26d1b5

Browse files
Fix PurePath.relative_to links in the pathlib documentation. (GH-93268)
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 8ef7929) Co-authored-by: jacksonriley <52106215+jacksonriley@users.noreply.github.com>
1 parent 5203255 commit f26d1b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/pathlib.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ Below is a table mapping various :mod:`os` functions to their corresponding
12841284
:func:`os.link` :meth:`Path.hardlink_to`
12851285
:func:`os.symlink` :meth:`Path.symlink_to`
12861286
:func:`os.readlink` :meth:`Path.readlink`
1287-
:func:`os.path.relpath` :meth:`Path.relative_to` [#]_
1287+
:func:`os.path.relpath` :meth:`PurePath.relative_to` [#]_
12881288
:func:`os.stat` :meth:`Path.stat`,
12891289
:meth:`Path.owner`,
12901290
:meth:`Path.group`
@@ -1299,4 +1299,4 @@ Below is a table mapping various :mod:`os` functions to their corresponding
12991299
.. rubric:: Footnotes
13001300

13011301
.. [#] :func:`os.path.abspath` normalizes the resulting path, which may change its meaning in the presence of symlinks, while :meth:`Path.absolute` does not.
1302-
.. [#] :meth:`Path.relative_to` requires ``self`` to be the subpath of the argument, but :func:`os.path.relpath` does not.
1302+
.. [#] :meth:`PurePath.relative_to` requires ``self`` to be the subpath of the argument, but :func:`os.path.relpath` does not.

0 commit comments

Comments
 (0)