Skip to content

Commit 51858aa

Browse files
authored
[3.11] gh-101100: Fix Sphinx warning in references with asterisks (GH-113029) (#113044)
1 parent b8a6eee commit 51858aa

20 files changed

+54
-52
lines changed

Doc/library/bdb.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ The :mod:`bdb` module also defines two classes:
294294
.. method:: set_quit()
295295

296296
Set the :attr:`quitting` attribute to ``True``. This raises :exc:`BdbQuit` in
297-
the next call to one of the :meth:`dispatch_\*` methods.
297+
the next call to one of the :meth:`!dispatch_\*` methods.
298298

299299

300300
Derived classes and clients can call the following methods to manipulate

Doc/library/cmd.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ A :class:`Cmd` instance has the following methods:
7373

7474
This method will return when the :meth:`postcmd` method returns a true value.
7575
The *stop* argument to :meth:`postcmd` is the return value from the command's
76-
corresponding :meth:`do_\*` method.
76+
corresponding :meth:`!do_\*` method.
7777

7878
If completion is enabled, completing commands will be done automatically, and
7979
completing of commands args is done by calling :meth:`complete_foo` with
@@ -88,7 +88,7 @@ A :class:`Cmd` instance has the following methods:
8888
:meth:`help_bar`, and if that is not present, prints the docstring of
8989
:meth:`do_bar`, if available. With no argument, :meth:`do_help` lists all
9090
available help topics (that is, all commands with corresponding
91-
:meth:`help_\*` methods or commands that have docstrings), and also lists any
91+
:meth:`!help_\*` methods or commands that have docstrings), and also lists any
9292
undocumented commands.
9393

9494

@@ -98,7 +98,7 @@ A :class:`Cmd` instance has the following methods:
9898
This may be overridden, but should not normally need to be; see the
9999
:meth:`precmd` and :meth:`postcmd` methods for useful execution hooks. The
100100
return value is a flag indicating whether interpretation of commands by the
101-
interpreter should stop. If there is a :meth:`do_\*` method for the command
101+
interpreter should stop. If there is a :meth:`!do_\*` method for the command
102102
*str*, the return value of that method is returned, otherwise the return value
103103
from the :meth:`default` method is returned.
104104

@@ -118,7 +118,7 @@ A :class:`Cmd` instance has the following methods:
118118
.. method:: Cmd.completedefault(text, line, begidx, endidx)
119119

120120
Method called to complete an input line when no command-specific
121-
:meth:`complete_\*` method is available. By default, it returns an empty list.
121+
:meth:`!complete_\*` method is available. By default, it returns an empty list.
122122

123123

124124
.. method:: Cmd.columnize(list, displaywidth=80)
@@ -199,14 +199,14 @@ Instances of :class:`Cmd` subclasses have some public instance variables:
199199
.. attribute:: Cmd.misc_header
200200

201201
The header to issue if the help output has a section for miscellaneous help
202-
topics (that is, there are :meth:`help_\*` methods without corresponding
203-
:meth:`do_\*` methods).
202+
topics (that is, there are :meth:`!help_\*` methods without corresponding
203+
:meth:`!do_\*` methods).
204204

205205

206206
.. attribute:: Cmd.undoc_header
207207

208208
The header to issue if the help output has a section for undocumented commands
209-
(that is, there are :meth:`do_\*` methods without corresponding :meth:`help_\*`
209+
(that is, there are :meth:`!do_\*` methods without corresponding :meth:`!help_\*`
210210
methods).
211211

212212

Doc/library/configparser.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ ConfigParser Objects
955955
When *converters* is given, it should be a dictionary where each key
956956
represents the name of a type converter and each value is a callable
957957
implementing the conversion from string to the desired datatype. Every
958-
converter gets its own corresponding :meth:`get*()` method on the parser
958+
converter gets its own corresponding :meth:`!get*()` method on the parser
959959
object and section proxies.
960960

961961
.. versionchanged:: 3.1

Doc/library/csv.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ An example for :class:`Sniffer` use::
305305
# ... process CSV file contents here ...
306306

307307

308+
.. _csv-constants:
309+
308310
The :mod:`csv` module defines the following constants:
309311

310312
.. data:: QUOTE_ALL
@@ -410,8 +412,8 @@ Dialects support the following attributes:
410412
.. attribute:: Dialect.quoting
411413

412414
Controls when quotes should be generated by the writer and recognised by the
413-
reader. It can take on any of the :const:`QUOTE_\*` constants (see section
414-
:ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`.
415+
reader. It can take on any of the :ref:`QUOTE_\* constants <csv-constants>`
416+
and defaults to :const:`QUOTE_MINIMAL`.
415417

416418

417419
.. attribute:: Dialect.skipinitialspace

Doc/library/http.server.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ provides three different variants:
6565

6666
The handler will parse the request and the headers, then call a method
6767
specific to the request type. The method name is constructed from the
68-
request. For example, for the request method ``SPAM``, the :meth:`do_SPAM`
68+
request. For example, for the request method ``SPAM``, the :meth:`!do_SPAM`
6969
method will be called with no arguments. All of the relevant information is
7070
stored in instance variables of the handler. Subclasses should not need to
71-
override or extend the :meth:`__init__` method.
71+
override or extend the :meth:`!__init__` method.
7272

7373
:class:`BaseHTTPRequestHandler` has the following instance variables:
7474

@@ -187,13 +187,13 @@ provides three different variants:
187187

188188
Calls :meth:`handle_one_request` once (or, if persistent connections are
189189
enabled, multiple times) to handle incoming HTTP requests. You should
190-
never need to override it; instead, implement appropriate :meth:`do_\*`
190+
never need to override it; instead, implement appropriate :meth:`!do_\*`
191191
methods.
192192

193193
.. method:: handle_one_request()
194194

195195
This method will parse and dispatch the request to the appropriate
196-
:meth:`do_\*` method. You should never need to override it.
196+
:meth:`!do_\*` method. You should never need to override it.
197197

198198
.. method:: handle_expect_100()
199199

Doc/library/locale.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ The :mod:`locale` module defines the following exception and functions:
309309
.. function:: getlocale(category=LC_CTYPE)
310310

311311
Returns the current setting for the given locale category as sequence containing
312-
*language code*, *encoding*. *category* may be one of the :const:`LC_\*` values
312+
*language code*, *encoding*. *category* may be one of the :const:`!LC_\*` values
313313
except :const:`LC_ALL`. It defaults to :const:`LC_CTYPE`.
314314

315315
Except for the code ``'C'``, the language code corresponds to :rfc:`1766`.

Doc/library/os.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3728,7 +3728,7 @@ to be ignored.
37283728
The "l" and "v" variants of the :func:`exec\* <execl>` functions differ in how
37293729
command-line arguments are passed. The "l" variants are perhaps the easiest
37303730
to work with if the number of parameters is fixed when the code is written; the
3731-
individual parameters simply become additional parameters to the :func:`execl\*`
3731+
individual parameters simply become additional parameters to the :func:`!execl\*`
37323732
functions. The "v" variants are good when the number of parameters is
37333733
variable, with the arguments being passed in a list or tuple as the *args*
37343734
parameter. In either case, the arguments to the child process should start with
@@ -4228,7 +4228,7 @@ written in Python, such as a mail server's external command delivery program.
42284228
command-line arguments are passed. The "l" variants are perhaps the easiest
42294229
to work with if the number of parameters is fixed when the code is written; the
42304230
individual parameters simply become additional parameters to the
4231-
:func:`spawnl\*` functions. The "v" variants are good when the number of
4231+
:func:`!spawnl\*` functions. The "v" variants are good when the number of
42324232
parameters is variable, with the arguments being passed in a list or tuple as
42334233
the *args* parameter. In either case, the arguments to the child process must
42344234
start with the name of the command being run.
@@ -4278,7 +4278,7 @@ written in Python, such as a mail server's external command delivery program.
42784278
P_NOWAITO
42794279

42804280
Possible values for the *mode* parameter to the :func:`spawn\* <spawnl>` family of
4281-
functions. If either of these values is given, the :func:`spawn\*` functions
4281+
functions. If either of these values is given, the :func:`spawn\* <spawnl>` functions
42824282
will return as soon as the new process has been created, with the process id as
42834283
the return value.
42844284

@@ -4288,7 +4288,7 @@ written in Python, such as a mail server's external command delivery program.
42884288
.. data:: P_WAIT
42894289

42904290
Possible value for the *mode* parameter to the :func:`spawn\* <spawnl>` family of
4291-
functions. If this is given as *mode*, the :func:`spawn\*` functions will not
4291+
functions. If this is given as *mode*, the :func:`spawn\* <spawnl>` functions will not
42924292
return until the new process has run to completion and will return the exit code
42934293
of the process the run is successful, or ``-signal`` if a signal kills the
42944294
process.

Doc/library/resource.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ These functions are used to retrieve resource usage information:
277277

278278
This function returns an object that describes the resources consumed by either
279279
the current process or its children, as specified by the *who* parameter. The
280-
*who* parameter should be specified using one of the :const:`RUSAGE_\*`
280+
*who* parameter should be specified using one of the :const:`!RUSAGE_\*`
281281
constants described below.
282282

283283
A simple example::
@@ -353,7 +353,7 @@ These functions are used to retrieve resource usage information:
353353
Returns the number of bytes in a system page. (This need not be the same as the
354354
hardware page size.)
355355

356-
The following :const:`RUSAGE_\*` symbols are passed to the :func:`getrusage`
356+
The following :const:`!RUSAGE_\*` symbols are passed to the :func:`getrusage`
357357
function to specify which processes information should be provided for.
358358

359359

Doc/library/socket.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ Exceptions
285285
The accompanying value is a pair ``(error, string)`` representing an error
286286
returned by a library call. *string* represents the description of
287287
*error*, as returned by the :c:func:`gai_strerror` C function. The
288-
numeric *error* value will match one of the :const:`EAI_\*` constants
288+
numeric *error* value will match one of the :const:`!EAI_\*` constants
289289
defined in this module.
290290

291291
.. versionchanged:: 3.3
@@ -1418,7 +1418,7 @@ to sockets.
14181418
.. method:: socket.getsockopt(level, optname[, buflen])
14191419

14201420
Return the value of the given socket option (see the Unix man page
1421-
:manpage:`getsockopt(2)`). The needed symbolic constants (:const:`SO_\*` etc.)
1421+
:manpage:`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\* etc. <socket-unix-constants>`)
14221422
are defined in this module. If *buflen* is absent, an integer option is assumed
14231423
and its integer value is returned by the function. If *buflen* is present, it
14241424
specifies the maximum length of the buffer used to receive the option in, and
@@ -1838,8 +1838,8 @@ to sockets.
18381838
.. index:: pair: module; struct
18391839

18401840
Set the value of the given socket option (see the Unix manual page
1841-
:manpage:`setsockopt(2)`). The needed symbolic constants are defined in the
1842-
:mod:`socket` module (:const:`SO_\*` etc.). The value can be an integer,
1841+
:manpage:`setsockopt(2)`). The needed symbolic constants are defined in this
1842+
module (:ref:`!SO_\* etc. <socket-unix-constants>`). The value can be an integer,
18431843
``None`` or a :term:`bytes-like object` representing a buffer. In the later
18441844
case it is up to the caller to ensure that the bytestring contains the
18451845
proper bits (see the optional built-in module :mod:`struct` for a way to

Doc/library/unittest.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ testing code::
384384
widget = Widget('The widget')
385385
self.assertEqual(widget.size(), (50, 50))
386386

387-
Note that in order to test something, we use one of the :meth:`assert\*`
388-
methods provided by the :class:`TestCase` base class. If the test fails, an
387+
Note that in order to test something, we use one of the :ref:`assert\* methods <assert-methods>`
388+
provided by the :class:`TestCase` base class. If the test fails, an
389389
exception will be raised with an explanatory message, and :mod:`unittest`
390390
will identify the test case as a :dfn:`failure`. Any other exceptions will be
391391
treated as :dfn:`errors`.
@@ -1962,14 +1962,14 @@ Loading and running tests
19621962
String giving the prefix of method names which will be interpreted as test
19631963
methods. The default value is ``'test'``.
19641964

1965-
This affects :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*`
1965+
This affects :meth:`getTestCaseNames` and all the ``loadTestsFrom*``
19661966
methods.
19671967

19681968

19691969
.. attribute:: sortTestMethodsUsing
19701970

19711971
Function to be used to compare method names when sorting them in
1972-
:meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` methods.
1972+
:meth:`getTestCaseNames` and all the ``loadTestsFrom*`` methods.
19731973

19741974

19751975
.. attribute:: suiteClass
@@ -1978,7 +1978,7 @@ Loading and running tests
19781978
methods on the resulting object are needed. The default value is the
19791979
:class:`TestSuite` class.
19801980

1981-
This affects all the :meth:`loadTestsFrom\*` methods.
1981+
This affects all the ``loadTestsFrom*`` methods.
19821982

19831983
.. attribute:: testNamePatterns
19841984

@@ -1991,7 +1991,7 @@ Loading and running tests
19911991
so unlike patterns passed to the ``-k`` option, simple substring patterns
19921992
will have to be converted using ``*`` wildcards.
19931993

1994-
This affects all the :meth:`loadTestsFrom\*` methods.
1994+
This affects all the ``loadTestsFrom*`` methods.
19951995

19961996
.. versionadded:: 3.7
19971997

@@ -2025,7 +2025,7 @@ Loading and running tests
20252025

20262026
A list containing 2-tuples of :class:`TestCase` instances and strings
20272027
holding formatted tracebacks. Each tuple represents a test where a failure
2028-
was explicitly signalled using the :meth:`TestCase.assert\*` methods.
2028+
was explicitly signalled using the :ref:`assert\* methods <assert-methods>`.
20292029

20302030
.. attribute:: skipped
20312031

Doc/library/urllib.request.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,8 @@ The following attribute and methods should only be used by classes derived from
723723
.. note::
724724

725725
The convention has been adopted that subclasses defining
726-
:meth:`<protocol>_request` or :meth:`<protocol>_response` methods are named
727-
:class:`\*Processor`; all others are named :class:`\*Handler`.
726+
:meth:`!<protocol>_request` or :meth:`!<protocol>_response` methods are named
727+
:class:`!\*Processor`; all others are named :class:`!\*Handler`.
728728

729729

730730
.. attribute:: BaseHandler.parent
@@ -844,9 +844,9 @@ HTTPRedirectHandler Objects
844844
.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl)
845845

846846
Return a :class:`Request` or ``None`` in response to a redirect. This is called
847-
by the default implementations of the :meth:`http_error_30\*` methods when a
847+
by the default implementations of the :meth:`!http_error_30\*` methods when a
848848
redirection is received from the server. If a redirection should take place,
849-
return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the
849+
return a new :class:`Request` to allow :meth:`!http_error_30\*` to perform the
850850
redirect to *newurl*. Otherwise, raise :exc:`~urllib.error.HTTPError` if
851851
no other handler should try to handle this URL, or return ``None`` if you
852852
can't but another handler might.

Doc/library/xml.dom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ NamedNodeMap Objects
734734
attribute node. Get its value with the :attr:`value` attribute.
735735

736736
There are also experimental methods that give this class more mapping behavior.
737-
You can use them or you can use the standardized :meth:`getAttribute\*` family
737+
You can use them or you can use the standardized :meth:`!getAttribute\*` family
738738
of methods on the :class:`Element` objects.
739739

740740

Doc/whatsnew/2.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ complete list of changes, or look through the CVS logs for all the details.
13621362
:mod:`os` module. (Contributed by Gustavo Niemeyer, Geert Jansen, and Denis S.
13631363
Otkidach.)
13641364

1365-
* In the :mod:`os` module, the :func:`\*stat` family of functions can now report
1365+
* In the :mod:`os` module, the :func:`!\*stat` family of functions can now report
13661366
fractions of a second in a timestamp. Such time stamps are represented as
13671367
floats, similar to the value returned by :func:`time.time`.
13681368

Doc/whatsnew/2.4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ complete list of changes, or look through the CVS logs for all the details.
11641164

11651165
* A number of functions were added to the :mod:`locale` module, such as
11661166
:func:`bind_textdomain_codeset` to specify a particular encoding and a family of
1167-
:func:`l\*gettext` functions that return messages in the chosen encoding.
1167+
:func:`!l\*gettext` functions that return messages in the chosen encoding.
11681168
(Contributed by Gustavo Niemeyer.)
11691169

11701170
* Some keyword arguments were added to the :mod:`logging` package's

Doc/whatsnew/2.5.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,10 +1167,10 @@ marked in the following list.
11671167
11681168
* It's now illegal to mix iterating over a file with ``for line in file`` and
11691169
calling the file object's :meth:`read`/:meth:`readline`/:meth:`readlines`
1170-
methods. Iteration uses an internal buffer and the :meth:`read\*` methods
1170+
methods. Iteration uses an internal buffer and the :meth:`!read\*` methods
11711171
don't use that buffer. Instead they would return the data following the
11721172
buffer, causing the data to appear out of order. Mixing iteration and these
1173-
methods will now trigger a :exc:`ValueError` from the :meth:`read\*` method.
1173+
methods will now trigger a :exc:`ValueError` from the :meth:`!read\*` method.
11741174
(Implemented by Thomas Wouters.)
11751175

11761176
.. Patch 1397960

Doc/whatsnew/2.7.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ changes, or look through the Subversion logs for all the details.
14161416
:func:`~math.lgamma` for the natural log of the Gamma function.
14171417
(Contributed by Mark Dickinson and nirinA raseliarison; :issue:`3366`.)
14181418

1419-
* The :mod:`multiprocessing` module's :class:`Manager*` classes
1419+
* The :mod:`multiprocessing` module's :class:`!Manager*` classes
14201420
can now be passed a callable that will be called whenever
14211421
a subprocess is started, along with a set of arguments that will be
14221422
passed to the callable.

Doc/whatsnew/3.4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1936,7 +1936,7 @@ Other Improvements
19361936
* The :ref:`python <using-on-cmdline>` command has a new :ref:`option
19371937
<using-on-misc-options>`, ``-I``, which causes it to run in "isolated mode",
19381938
which means that :data:`sys.path` contains neither the script's directory nor
1939-
the user's ``site-packages`` directory, and all :envvar:`PYTHON*` environment
1939+
the user's ``site-packages`` directory, and all :envvar:`!PYTHON*` environment
19401940
variables are ignored (it implies both ``-s`` and ``-E``). Other
19411941
restrictions may also be applied in the future, with the goal being to
19421942
isolate the execution of a script from the user's environment. This is

Misc/NEWS.d/3.10.0a1.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ Opt out serialization/deserialization for _random.Random
605605
.. nonce: jxJ4yn
606606
.. section: Core and Builtins
607607
608-
Rename `PyPegen*` functions to `PyParser*`, so that we can remove the old
609-
set of `PyParser*` functions that were using the old parser, but keep
608+
Rename ``PyPegen*`` functions to ``PyParser*``, so that we can remove the old
609+
set of ``PyParser*`` functions that were using the old parser, but keep
610610
everything backwards-compatible.
611611

612612
..

Misc/NEWS.d/3.6.0a2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ configuring text widget colors to a new function.
603603
.. nonce: RbyFuV
604604
.. section: IDLE
605605
606-
Rename many `idlelib/*.py` and `idle_test/test_*.py` files. Edit files to
606+
Rename many ``idlelib/*.py`` and ``idle_test/test_*.py`` files. Edit files to
607607
replace old names with new names when the old name referred to the module
608608
rather than the class it contained. See the issue and IDLE section in What's
609609
New in 3.6 for more.

Misc/NEWS.d/3.9.0a1.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,7 +2534,7 @@ object when `self._spec_signature` exists. Patch by Elizabeth Uselton
25342534
.. nonce: iXGuoi
25352535
.. section: Library
25362536
2537-
Make `from tkinter import *` import only the expected objects.
2537+
Make ``from tkinter import *`` import only the expected objects.
25382538

25392539
..
25402540
@@ -3117,9 +3117,9 @@ Ensure cookies with ``expires`` attribute are handled in
31173117
.. section: Library
31183118
31193119
Fix an unintended ValueError from :func:`subprocess.run` when checking for
3120-
conflicting `input` and `stdin` or `capture_output` and `stdout` or `stderr`
3121-
args when they were explicitly provided but with `None` values within a
3122-
passed in `**kwargs` dict rather than as passed directly by name. Patch
3120+
conflicting *input* and *stdin* or *capture_output* and *stdout* or *stderr*
3121+
args when they were explicitly provided but with ``None`` values within a
3122+
passed in ``**kwargs`` dict rather than as passed directly by name. Patch
31233123
contributed by Rémi Lapeyre.
31243124

31253125
..
@@ -3546,7 +3546,7 @@ Patch by Stein Karlsen.
35463546
.. nonce: XaJDei
35473547
.. section: Library
35483548
3549-
lib2to3 now recognizes expressions after ``*`` and `**` like in ``f(*[] or
3549+
lib2to3 now recognizes expressions after ``*`` and ``**`` like in ``f(*[] or
35503550
[])``.
35513551

35523552
..

0 commit comments

Comments
 (0)