Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[3.10] 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>
  • Loading branch information
jacksonriley committed Jun 7, 2022
commit 8eb09c8d1bd80fd0bc93d5b962c442ca2e08f98d
4 changes: 2 additions & 2 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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.