8000 Fix `Path.relative_to` links in the pathlib documentation. by jacksonriley · Pull Request #93268 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Fix Path.relative_to links in the pathlib documentation. #93268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2022
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
Fix PurePath.relative_to links in the pathlib documentation.
These are currently broken (don't end up being hyperlinks) as they refer to :meth:`Path.relative_to` rather than :meth:`PurePath.relative_to`, and `relative_to` is a method on `PurePath`.
  • Loading branch information
jacksonriley committed May 26, 2022
commit e6f2bbf9da8e586d9d711585ef5f9af5dd04437a
4 changes: 2 additions & 2 deletions Doc/library/pathlib.rst
6C12
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` 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.
0