Skip to content
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

bpo-46879: Fix incorrect sphinx object names in doc #31615

Merged
merged 2 commits into from
May 19, 2022

Conversation

not-my-profile
Copy link
Contributor

@not-my-profile not-my-profile commented Feb 28, 2022

API members documented in sphinx have an object name, which allow the
documentation to be linked from other projects. Sphinx calculates the
object name by prefixing the current module name to the directive
argument, e.g:

.. module:: foo
.. function:: bar.baz

becomes foo.bar.baz. Since these anchors aren't displayed in the
documentation, some mistakes have crept in, namely the Python stdlib
documentation currently contains the objects:

  • asyncio.asyncio.subprocess.DEVNULL
  • asyncio.asyncio.subprocess.PIPE
  • asyncio.asyncio.subprocess.STDOUT
  • asyncio.asyncio.subprocess.Process
  • multiprocessing.sharedctypes.multiprocessing.Manager
  • xml.etree.ElementTree.xml.etree.ElementInclude

This commit fixes this by making use of the :module: option which
without an argument makes sphinx take the directive argument as is
for the object name (avoiding the prefixing of the current module
name that led to these broken object names).

https://bugs.python.org/issue46879

API members documented in sphinx have an object name, which allow the
documentation to be linked from other projects. Sphinx calculates the
object name by prefixing the current module name to the directive
argument, e.g:

.. module:: foo
.. function:: bar.baz

becomes foo.bar.baz. Since these anchors aren't displayed in the
documentation, some mistakes have crept in, namely the Python stdlib
documentation currently contains the objects:

* asyncio.asyncio.subprocess.DEVNULL
* asyncio.asyncio.subprocess.PIPE
* asyncio.asyncio.subprocess.STDOUT
* asyncio.asyncio.subprocess.Process
* multiprocessing.sharedctypes.multiprocessing.Manager
* xml.etree.ElementTree.xml.etree.ElementInclude

This commit fixes this by making use of the :module: option which
without an argument makes sphinx take the directive argument as is
for the object name (avoiding the prefixing of the current module
name that led to these broken object names).
@not-my-profile
Copy link
Contributor Author

How does backporting work? I'd like this fix to be backported all the way to 3.7.

@merwok
Copy link
Member

merwok commented Mar 2, 2022

The development process is documented here: https://devguide.python.org/devcycle/

At the moment, 3.10 and 3.9 receive bugfixes, 3.8 and 3.7 only security fixes.

@ambv ambv added the needs backport to 3.11 only security fixes label May 19, 2022
@ambv ambv merged commit 2cdd57f into python:main May 19, 2022
@miss-islington
Copy link
Contributor

Thanks @not-my-profile for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10, 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-92974 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label May 19, 2022
@bedevere-bot
Copy link

GH-92975 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 19, 2022
API members documented in sphinx have an object name, which allow the
documentation to be linked from other projects. Sphinx calculates the
object name by prefixing the current module name to the directive
argument, e.g:

.. module:: foo
.. function:: bar.baz

becomes foo.bar.baz. Since these anchors aren't displayed in the
documentation, some mistakes have crept in, namely the Python stdlib
documentation currently contains the objects:

* asyncio.asyncio.subprocess.DEVNULL
* asyncio.asyncio.subprocess.PIPE
* asyncio.asyncio.subprocess.STDOUT
* asyncio.asyncio.subprocess.Process
* multiprocessing.sharedctypes.multiprocessing.Manager
* xml.etree.ElementTree.xml.etree.ElementInclude

This commit fixes this by making use of the :module: option which
without an argument makes sphinx take the directive argument as is
for the object name (avoiding the prefixing of the current module
name that led to these broken object names).

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 2cdd57f)

Co-authored-by: Martin Fischer <martin@push-f.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 19, 2022
API members documented in sphinx have an object name, which allow the
documentation to be linked from other projects. Sphinx calculates the
object name by prefixing the current module name to the directive
argument, e.g:

.. module:: foo
.. function:: bar.baz

becomes foo.bar.baz. Since these anchors aren't displayed in the
documentation, some mistakes have crept in, namely the Python stdlib
documentation currently contains the objects:

* asyncio.asyncio.subprocess.DEVNULL
* asyncio.asyncio.subprocess.PIPE
* asyncio.asyncio.subprocess.STDOUT
* asyncio.asyncio.subprocess.Process
* multiprocessing.sharedctypes.multiprocessing.Manager
* xml.etree.ElementTree.xml.etree.ElementInclude

This commit fixes this by making use of the :module: option which
without an argument makes sphinx take the directive argument as is
for the object name (avoiding the prefixing of the current module
name that led to these broken object names).

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 2cdd57f)

Co-authored-by: Martin Fischer <martin@push-f.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label May 19, 2022
@bedevere-bot
Copy link

GH-92976 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 19, 2022
API members documented in sphinx have an object name, which allow the
documentation to be linked from other projects. Sphinx calculates the
object name by prefixing the current module name to the directive
argument, e.g:

.. module:: foo
.. function:: bar.baz

becomes foo.bar.baz. Since these anchors aren't displayed in the
documentation, some mistakes have crept in, namely the Python stdlib
documentation currently contains the objects:

* asyncio.asyncio.subprocess.DEVNULL
* asyncio.asyncio.subprocess.PIPE
* asyncio.asyncio.subprocess.STDOUT
* asyncio.asyncio.subprocess.Process
* multiprocessing.sharedctypes.multiprocessing.Manager
* xml.etree.ElementTree.xml.etree.ElementInclude

This commit fixes this by making use of the :module: option which
without an argument makes sphinx take the directive argument as is
for the object name (avoiding the prefixing of the current module
name that led to these broken object names).

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 2cdd57f)

Co-authored-by: Martin Fischer <martin@push-f.com>
ambv pushed a commit that referenced this pull request May 19, 2022
)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 2cdd57f)

Co-authored-by: Martin Fischer <martin@push-f.com>
ambv added a commit that referenced this pull request May 19, 2022
)

(cherry picked from commit 2cdd57f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Martin Fischer <martin@push-f.com>
ambv added a commit that referenced this pull request May 19, 2022
)

(cherry picked from commit 2cdd57f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Martin Fischer <martin@push-f.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants