8000 bpo-46879: Fix incorrect sphinx object names in doc (GH-31615) · python/cpython@2cdd57f · GitHub
[go: up one dir, main page]

Skip to content

Commit 2cdd57f

Browse files
not-my-profileambv
andauthored
bpo-46879: Fix incorrect sphinx object names in doc (GH-31615)
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>
1 parent 84b8600 commit 2cdd57f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Doc/library/asyncio-subprocess.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Constants
124124
=========
125125

126126
.. data:: asyncio.subprocess.PIPE
127+
:module:
127128

128129
Can be passed to the *stdin*, *stdout* or *stderr* parameters.
129130

@@ -137,11 +138,13 @@ Constants
137138
attributes will point to :class:`StreamReader` instances.
138139

139140
.. data:: asyncio.subprocess.STDOUT
141+
:module:
140142

141143
Special value that can be used as the *stderr* argument and indicates
142144
that standard error should be redirected into standard output.
143145

144146
.. data:: asyncio.subprocess.DEVNULL
147+
:module:
145148

146149
Special value that can be used as the *stdin*, *stdout* or *stderr* argument
147150
to process creation functions. It indicates that the special file
@@ -157,6 +160,7 @@ wrapper that allows communicating with subprocesses and watching for
157160
their completion.
158161

159162
.. class:: asyncio.subprocess.Process
163+
:module:
160164

161165
An object that wraps OS processes created by the
162166
:func:`create_subprocess_exec` and :func:`create_subprocess_shell`

Doc/library/multiprocessing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,6 +1666,7 @@ different machines. A manager object controls a server process which manages
16661666
proxies.
16671667

16681668
.. function:: multiprocessing.Manager()
1669+
:module:
16691670

16701671
Returns a started :class:`~multiprocessing.managers.SyncManager` object which
16711672
can be used for sharing objects between processes. The returned manager

Doc/library/xml.etree.elementtree.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@ Functions
826826
^^^^^^^^^
827827

828828
.. function:: xml.etree.ElementInclude.default_loader( href, parse, encoding=None)
829+
:module:
829830

830831
Default loader. This default loader reads an included resource from disk. *href* is a URL.
831832
*parse* is for parse mode either "xml" or "text". *encoding*
@@ -837,6 +838,7 @@ Functions
837838

838839
.. function:: xml.etree.ElementInclude.include( elem, loader=None, base_url=None, \
839840
max_depth=6)
841+
:module:
840842

841843
This function expands XInclude directives. *elem* is the root element. *loader* is
842844
an optional resource loader. If omitted, it defaults to :func:`default_loader`.

0 commit comments

Comments
 (0)
0