]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-101100: Fix Sphinx warning in references with asterisks (GH-113029) (#113044)
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Wed, 13 Dec 2023 09:02:20 +0000 (11:02 +0200)
committerGitHub <noreply@github.com>
Wed, 13 Dec 2023 09:02:20 +0000 (11:02 +0200)
20 files changed:
Doc/library/bdb.rst
Doc/library/cmd.rst
Doc/library/configparser.rst
Doc/library/csv.rst
Doc/library/http.server.rst
Doc/library/locale.rst
Doc/library/os.rst
Doc/library/resource.rst
Doc/library/socket.rst
Doc/library/unittest.rst
Doc/library/urllib.request.rst
Doc/library/xml.dom.rst
Doc/whatsnew/2.3.rst
Doc/whatsnew/2.4.rst
Doc/whatsnew/2.5.rst
Doc/whatsnew/2.7.rst
Doc/whatsnew/3.4.rst
Misc/NEWS.d/3.10.0a1.rst
Misc/NEWS.d/3.6.0a2.rst
Misc/NEWS.d/3.9.0a1.rst

index d201dc963b599506b26dc5bb9ba078c82f208eec..4ce5c9bcde38ff1998ec6ccdd57d550d47d12bba 100644 (file)
@@ -294,7 +294,7 @@ The :mod:`bdb` module also defines two classes:
    .. method:: set_quit()
 
       Set the :attr:`quitting` attribute to ``True``.  This raises :exc:`BdbQuit` in
-      the next call to one of the :meth:`dispatch_\*` methods.
+      the next call to one of the :meth:`!dispatch_\*` methods.
 
 
    Derived classes and clients can call the following methods to manipulate
index fd5df96dfd0b3d692ddcadc3262fc79783425f54..0093605986c72e32a401f7d3bf5c4d2399752af1 100644 (file)
@@ -73,7 +73,7 @@ A :class:`Cmd` instance has the following methods:
 
    This method will return when the :meth:`postcmd` method returns a true value.
    The *stop* argument to :meth:`postcmd` is the return value from the command's
-   corresponding :meth:`do_\*` method.
+   corresponding :meth:`!do_\*` method.
 
    If completion is enabled, completing commands will be done automatically, and
    completing of commands args is done by calling :meth:`complete_foo` with
@@ -88,7 +88,7 @@ A :class:`Cmd` instance has the following methods:
    :meth:`help_bar`, and if that is not present, prints the docstring of
    :meth:`do_bar`, if available.  With no argument, :meth:`do_help` lists all
    available help topics (that is, all commands with corresponding
-   :meth:`help_\*` methods or commands that have docstrings), and also lists any
+   :meth:`!help_\*` methods or commands that have docstrings), and also lists any
    undocumented commands.
 
 
@@ -98,7 +98,7 @@ A :class:`Cmd` instance has the following methods:
    This may be overridden, but should not normally need to be; see the
    :meth:`precmd` and :meth:`postcmd` methods for useful execution hooks.  The
    return value is a flag indicating whether interpretation of commands by the
-   interpreter should stop.  If there is a :meth:`do_\*` method for the command
+   interpreter should stop.  If there is a :meth:`!do_\*` method for the command
    *str*, the return value of that method is returned, otherwise the return value
    from the :meth:`default` method is returned.
 
@@ -118,7 +118,7 @@ A :class:`Cmd` instance has the following methods:
 .. method:: Cmd.completedefault(text, line, begidx, endidx)
 
    Method called to complete an input line when no command-specific
-   :meth:`complete_\*` method is available.  By default, it returns an empty list.
+   :meth:`!complete_\*` method is available.  By default, it returns an empty list.
 
 
 .. method:: Cmd.columnize(list, displaywidth=80)
@@ -199,14 +199,14 @@ Instances of :class:`Cmd` subclasses have some public instance variables:
 .. attribute:: Cmd.misc_header
 
    The header to issue if the help output has a section for miscellaneous  help
-   topics (that is, there are :meth:`help_\*` methods without corresponding
-   :meth:`do_\*` methods).
+   topics (that is, there are :meth:`!help_\*` methods without corresponding
+   :meth:`!do_\*` methods).
 
 
 .. attribute:: Cmd.undoc_header
 
    The header to issue if the help output has a section for undocumented  commands
-   (that is, there are :meth:`do_\*` methods without corresponding :meth:`help_\*`
+   (that is, there are :meth:`!do_\*` methods without corresponding :meth:`!help_\*`
    methods).
 
 
index 819c3799b08da70a11db7c52b57c94ddb0858934..3f15b20fb4871ccd682bc1678e29ee0f977b66c4 100644 (file)
@@ -955,7 +955,7 @@ ConfigParser Objects
    When *converters* is given, it should be a dictionary where each key
    represents the name of a type converter and each value is a callable
    implementing the conversion from string to the desired datatype.  Every
-   converter gets its own corresponding :meth:`get*()` method on the parser
+   converter gets its own corresponding :meth:`!get*()` method on the parser
    object and section proxies.
 
    .. versionchanged:: 3.1
index 52f76304a10529e0607606752fad73cd129a48f6..3983d7f9b6a46dfa90be026a4a83d7ae45f8a4e0 100644 (file)
@@ -305,6 +305,8 @@ An example for :class:`Sniffer` use::
        # ... process CSV file contents here ...
 
 
+.. _csv-constants:
+
 The :mod:`csv` module defines the following constants:
 
 .. data:: QUOTE_ALL
@@ -410,8 +412,8 @@ Dialects support the following attributes:
 .. attribute:: Dialect.quoting
 
    Controls when quotes should be generated by the writer and recognised by the
-   reader.  It can take on any of the :const:`QUOTE_\*` constants (see section
-   :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`.
+   reader.  It can take on any of the :ref:`QUOTE_\* constants <csv-constants>`
+   and defaults to :const:`QUOTE_MINIMAL`.
 
 
 .. attribute:: Dialect.skipinitialspace
index 76c5956430f8e6c3ea57b79213052c4d4b8a1cdd..32bc999dc9b913557abdad113a394f156c6f456d 100644 (file)
@@ -65,10 +65,10 @@ provides three different variants:
 
    The handler will parse the request and the headers, then call a method
    specific to the request type. The method name is constructed from the
-   request. For example, for the request method ``SPAM``, the :meth:`do_SPAM`
+   request. For example, for the request method ``SPAM``, the :meth:`!do_SPAM`
    method will be called with no arguments. All of the relevant information is
    stored in instance variables of the handler.  Subclasses should not need to
-   override or extend the :meth:`__init__` method.
+   override or extend the :meth:`!__init__` method.
 
    :class:`BaseHTTPRequestHandler` has the following instance variables:
 
@@ -187,13 +187,13 @@ provides three different variants:
 
       Calls :meth:`handle_one_request` once (or, if persistent connections are
       enabled, multiple times) to handle incoming HTTP requests. You should
-      never need to override it; instead, implement appropriate :meth:`do_\*`
+      never need to override it; instead, implement appropriate :meth:`!do_\*`
       methods.
 
    .. method:: handle_one_request()
 
       This method will parse and dispatch the request to the appropriate
-      :meth:`do_\*` method.  You should never need to override it.
+      :meth:`!do_\*` method.  You should never need to override it.
 
    .. method:: handle_expect_100()
 
index 5ea5957eb143cd9bcb78cc75d1833d8d8d70de4f..3a07d2d1f4ce082778526780e8635944bf861837 100644 (file)
@@ -309,7 +309,7 @@ The :mod:`locale` module defines the following exception and functions:
 .. function:: getlocale(category=LC_CTYPE)
 
    Returns the current setting for the given locale category as sequence containing
-   *language code*, *encoding*. *category* may be one of the :const:`LC_\*` values
+   *language code*, *encoding*. *category* may be one of the :const:`!LC_\*` values
    except :const:`LC_ALL`.  It defaults to :const:`LC_CTYPE`.
 
    Except for the code ``'C'``, the language code corresponds to :rfc:`1766`.
index 087a01d2d9efc15702bcccb4b1afa78c84340b65..61e35965b07a4d10a257173a4dc6b8648fbf8287 100644 (file)
@@ -3728,7 +3728,7 @@ to be ignored.
    The "l" and "v" variants of the :func:`exec\* <execl>` functions differ in how
    command-line arguments are passed.  The "l" variants are perhaps the easiest
    to work with if the number of parameters is fixed when the code is written; the
-   individual parameters simply become additional parameters to the :func:`execl\*`
+   individual parameters simply become additional parameters to the :func:`!execl\*`
    functions.  The "v" variants are good when the number of parameters is
    variable, with the arguments being passed in a list or tuple as the *args*
    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.
    command-line arguments are passed.  The "l" variants are perhaps the easiest
    to work with if the number of parameters is fixed when the code is written; the
    individual parameters simply become additional parameters to the
-   :func:`spawnl\*` functions.  The "v" variants are good when the number of
+   :func:`!spawnl\*` functions.  The "v" variants are good when the number of
    parameters is variable, with the arguments being passed in a list or tuple as
    the *args* parameter.  In either case, the arguments to the child process must
    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.
           P_NOWAITO
 
    Possible values for the *mode* parameter to the :func:`spawn\* <spawnl>` family of
-   functions.  If either of these values is given, the :func:`spawn\*` functions
+   functions.  If either of these values is given, the :func:`spawn\* <spawnl>` functions
    will return as soon as the new process has been created, with the process id as
    the return value.
 
@@ -4288,7 +4288,7 @@ written in Python, such as a mail server's external command delivery program.
 .. data:: P_WAIT
 
    Possible value for the *mode* parameter to the :func:`spawn\* <spawnl>` family of
-   functions.  If this is given as *mode*, the :func:`spawn\*` functions will not
+   functions.  If this is given as *mode*, the :func:`spawn\* <spawnl>` functions will not
    return until the new process has run to completion and will return the exit code
    of the process the run is successful, or ``-signal`` if a signal kills the
    process.
index ef65674d1b0a787382181abd32f9775a8cd93a96..4e58b043f1da315b7bb6e390f2f13bb6c60708f5 100644 (file)
@@ -277,7 +277,7 @@ These functions are used to retrieve resource usage information:
 
    This function returns an object that describes the resources consumed by either
    the current process or its children, as specified by the *who* parameter.  The
-   *who* parameter should be specified using one of the :const:`RUSAGE_\*`
+   *who* parameter should be specified using one of the :const:`!RUSAGE_\*`
    constants described below.
 
    A simple example::
@@ -353,7 +353,7 @@ These functions are used to retrieve resource usage information:
    Returns the number of bytes in a system page. (This need not be the same as the
    hardware page size.)
 
-The following :const:`RUSAGE_\*` symbols are passed to the :func:`getrusage`
+The following :const:`!RUSAGE_\*` symbols are passed to the :func:`getrusage`
 function to specify which processes information should be provided for.
 
 
index b9f47ae2e6d3f4853c10aef1ae243836904f145a..809c8469e01fe510c2e44cb44359557d48285efc 100644 (file)
@@ -285,7 +285,7 @@ Exceptions
    The accompanying value is a pair ``(error, string)`` representing an error
    returned by a library call.  *string* represents the description of
    *error*, as returned by the :c:func:`gai_strerror` C function.  The
-   numeric *error* value will match one of the :const:`EAI_\*` constants
+   numeric *error* value will match one of the :const:`!EAI_\*` constants
    defined in this module.
 
    .. versionchanged:: 3.3
@@ -1418,7 +1418,7 @@ to sockets.
 .. method:: socket.getsockopt(level, optname[, buflen])
 
    Return the value of the given socket option (see the Unix man page
-   :manpage:`getsockopt(2)`).  The needed symbolic constants (:const:`SO_\*` etc.)
+   :manpage:`getsockopt(2)`).  The needed symbolic constants (:ref:`SO_\* etc. <socket-unix-constants>`)
    are defined in this module.  If *buflen* is absent, an integer option is assumed
    and its integer value is returned by the function.  If *buflen* is present, it
    specifies the maximum length of the buffer used to receive the option in, and
@@ -1838,8 +1838,8 @@ to sockets.
    .. index:: pair: module; struct
 
    Set the value of the given socket option (see the Unix manual page
-   :manpage:`setsockopt(2)`).  The needed symbolic constants are defined in the
-   :mod:`socket` module (:const:`SO_\*` etc.).  The value can be an integer,
+   :manpage:`setsockopt(2)`).  The needed symbolic constants are defined in this
+   module (:ref:`!SO_\* etc. <socket-unix-constants>`).  The value can be an integer,
    ``None`` or a :term:`bytes-like object` representing a buffer. In the later
    case it is up to the caller to ensure that the bytestring contains the
    proper bits (see the optional built-in module :mod:`struct` for a way to
index 48d37c0539a50c8d7199ed20aec2694ec60031a0..ce6e1ceb7e5f0bab3b7845b658c0b28aa9dde949 100644 (file)
@@ -384,8 +384,8 @@ testing code::
            widget = Widget('The widget')
            self.assertEqual(widget.size(), (50, 50))
 
-Note that in order to test something, we use one of the :meth:`assert\*`
-methods provided by the :class:`TestCase` base class.  If the test fails, an
+Note that in order to test something, we use one of the :ref:`assert\* methods <assert-methods>`
+provided by the :class:`TestCase` base class.  If the test fails, an
 exception will be raised with an explanatory message, and :mod:`unittest`
 will identify the test case as a :dfn:`failure`.  Any other exceptions will be
 treated as :dfn:`errors`.
@@ -1962,14 +1962,14 @@ Loading and running tests
       String giving the prefix of method names which will be interpreted as test
       methods.  The default value is ``'test'``.
 
-      This affects :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*`
+      This affects :meth:`getTestCaseNames` and all the ``loadTestsFrom*``
       methods.
 
 
    .. attribute:: sortTestMethodsUsing
 
       Function to be used to compare method names when sorting them in
-      :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` methods.
+      :meth:`getTestCaseNames` and all the ``loadTestsFrom*`` methods.
 
 
    .. attribute:: suiteClass
@@ -1978,7 +1978,7 @@ Loading and running tests
       methods on the resulting object are needed.  The default value is the
       :class:`TestSuite` class.
 
-      This affects all the :meth:`loadTestsFrom\*` methods.
+      This affects all the ``loadTestsFrom*`` methods.
 
    .. attribute:: testNamePatterns
 
@@ -1991,7 +1991,7 @@ Loading and running tests
       so unlike patterns passed to the ``-k`` option, simple substring patterns
       will have to be converted using ``*`` wildcards.
 
-      This affects all the :meth:`loadTestsFrom\*` methods.
+      This affects all the ``loadTestsFrom*`` methods.
 
       .. versionadded:: 3.7
 
@@ -2025,7 +2025,7 @@ Loading and running tests
 
       A list containing 2-tuples of :class:`TestCase` instances and strings
       holding formatted tracebacks. Each tuple represents a test where a failure
-      was explicitly signalled using the :meth:`TestCase.assert\*` methods.
+      was explicitly signalled using the :ref:`assert\* methods <assert-methods>`.
 
    .. attribute:: skipped
 
index 002dab8a65195c1150492ef6d1161f51d2590589..690f01c93a1ee7376aab4617812c15fc7f9f72c6 100644 (file)
@@ -723,8 +723,8 @@ The following attribute and methods should only be used by classes derived from
 .. note::
 
    The convention has been adopted that subclasses defining
-   :meth:`<protocol>_request` or :meth:`<protocol>_response` methods are named
-   :class:`\*Processor`; all others are named :class:`\*Handler`.
+   :meth:`!<protocol>_request` or :meth:`!<protocol>_response` methods are named
+   :class:`!\*Processor`; all others are named :class:`!\*Handler`.
 
 
 .. attribute:: BaseHandler.parent
@@ -844,9 +844,9 @@ HTTPRedirectHandler Objects
 .. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl)
 
    Return a :class:`Request` or ``None`` in response to a redirect. This is called
-   by the default implementations of the :meth:`http_error_30\*` methods when a
+   by the default implementations of the :meth:`!http_error_30\*` methods when a
    redirection is received from the server.  If a redirection should take place,
-   return a new :class:`Request` to allow :meth:`http_error_30\*` to perform the
+   return a new :class:`Request` to allow :meth:`!http_error_30\*` to perform the
    redirect to *newurl*.  Otherwise, raise :exc:`~urllib.error.HTTPError` if
    no other handler should try to handle this URL, or return ``None`` if you
    can't but another handler might.
index b387240a3716ccc5a3551196e37630efa5604246..d0e1b248d595d135527f5021bbac75379af49d3a 100644 (file)
@@ -734,7 +734,7 @@ NamedNodeMap Objects
    attribute node.  Get its value with the :attr:`value` attribute.
 
 There are also experimental methods that give this class more mapping behavior.
-You can use them or you can use the standardized :meth:`getAttribute\*` family
+You can use them or you can use the standardized :meth:`!getAttribute\*` family
 of methods on the :class:`Element` objects.
 
 
index eafe8b4d4e9779217ef25d6c21fb924a1f28c902..01f00dd17564d5f05cd949f8ffbe59f38c4629f1 100644 (file)
@@ -1362,7 +1362,7 @@ complete list of changes, or look through the CVS logs for all the details.
   :mod:`os` module. (Contributed by Gustavo Niemeyer, Geert Jansen, and Denis S.
   Otkidach.)
 
-* In the :mod:`os` module, the :func:`\*stat` family of functions can now report
+* In the :mod:`os` module, the :func:`!\*stat` family of functions can now report
   fractions of a second in a timestamp.  Such time stamps are represented as
   floats, similar to the value returned by :func:`time.time`.
 
index d61c0f3e1ba8a247fa5870b98c9111078e9e0a04..1d455294910509a59b61722c39dccfeb290dc4ab 100644 (file)
@@ -1164,7 +1164,7 @@ complete list of changes, or look through the CVS logs for all the details.
 
 * A number of functions were added to the :mod:`locale`  module, such as
   :func:`bind_textdomain_codeset` to specify a particular encoding and a family of
-  :func:`l\*gettext` functions that return messages in the chosen encoding.
+  :func:`!l\*gettext` functions that return messages in the chosen encoding.
   (Contributed by Gustavo Niemeyer.)
 
 * Some keyword arguments were added to the :mod:`logging` package's
index 3608153db073a6f05ff2e3b854346c79da5fb98a..9b1a12436ec935a67bb22b9d312e5adb18ea43f1 100644 (file)
@@ -1167,10 +1167,10 @@ marked in the following list.
 
 * It's now illegal to mix iterating over a file  with ``for line in file`` and
   calling  the file object's :meth:`read`/:meth:`readline`/:meth:`readlines`
-  methods.  Iteration uses an internal buffer and the  :meth:`read\*` methods
+  methods.  Iteration uses an internal buffer and the  :meth:`!read\*` methods
   don't use that buffer.   Instead they would return the data following the
   buffer, causing the data to appear out of order.  Mixing iteration and these
-  methods will now trigger a :exc:`ValueError` from the :meth:`read\*` method.
+  methods will now trigger a :exc:`ValueError` from the :meth:`!read\*` method.
   (Implemented by Thomas Wouters.)
 
   .. Patch 1397960
index bfcf8fbecc1c2e52a66fd4270b3f8ca6cb2551e5..2c057fb71759cb9ca7911fe363d45e88b3df63d7 100644 (file)
@@ -1416,7 +1416,7 @@ changes, or look through the Subversion logs for all the details.
   :func:`~math.lgamma` for the natural log of the Gamma function.
   (Contributed by Mark Dickinson and nirinA raseliarison; :issue:`3366`.)
 
-* The :mod:`multiprocessing` module's :class:`Manager*` classes
+* The :mod:`multiprocessing` module's :class:`!Manager*` classes
   can now be passed a callable that will be called whenever
   a subprocess is started, along with a set of arguments that will be
   passed to the callable.
index fa764830eba1fa0edce7092738ab8fb7d97e56a8..97153c2fddf8bb1488efd4c8f9008da38e2e8467 100644 (file)
@@ -1936,7 +1936,7 @@ Other Improvements
 * The :ref:`python <using-on-cmdline>` command has a new :ref:`option
   <using-on-misc-options>`, ``-I``, which causes it to run in "isolated mode",
   which means that :data:`sys.path` contains neither the script's directory nor
-  the user's ``site-packages`` directory, and all :envvar:`PYTHON*` environment
+  the user's ``site-packages`` directory, and all :envvar:`!PYTHON*` environment
   variables are ignored (it implies both ``-s`` and ``-E``).  Other
   restrictions may also be applied in the future, with the goal being to
   isolate the execution of a script from the user's environment.  This is
index 16f33637c88f739d2a5f38dc110a38b658f4af8c..564da0b4f74675271c705ed046ed3795dc6acadd 100644 (file)
@@ -605,8 +605,8 @@ Opt out serialization/deserialization for _random.Random
 .. nonce: jxJ4yn
 .. section: Core and Builtins
 
-Rename `PyPegen*` functions to `PyParser*`, so that we can remove the old
-set of `PyParser*` functions that were using the old parser, but keep
+Rename ``PyPegen*`` functions to ``PyParser*``, so that we can remove the old
+set of ``PyParser*`` functions that were using the old parser, but keep
 everything backwards-compatible.
 
 ..
index 1b336d7bc5137a2aad264bb7deaf2339f5616261..05b3d9f0463c1c15adbd8bbcd3e2700117634e42 100644 (file)
@@ -603,7 +603,7 @@ configuring text widget colors to a new function.
 .. nonce: RbyFuV
 .. section: IDLE
 
-Rename many `idlelib/*.py` and `idle_test/test_*.py` files. Edit files to
+Rename many ``idlelib/*.py`` and ``idle_test/test_*.py`` files. Edit files to
 replace old names with new names when the old name referred to the module
 rather than the class it contained. See the issue and IDLE section in What's
 New in 3.6 for more.
index 23f53f2dc647aa267fe359471bd8a9886fd749d5..3a2de00414bfe655daca3b1812df640cee045cc9 100644 (file)
@@ -2534,7 +2534,7 @@ object when `self._spec_signature` exists. Patch by Elizabeth Uselton
 .. nonce: iXGuoi
 .. section: Library
 
-Make `from tkinter import *` import only the expected objects.
+Make ``from tkinter import *`` import only the expected objects.
 
 ..
 
@@ -3117,9 +3117,9 @@ Ensure cookies with ``expires`` attribute are handled in
 .. section: Library
 
 Fix an unintended ValueError from :func:`subprocess.run` when checking for
-conflicting `input` and `stdin` or `capture_output` and `stdout` or `stderr`
-args when they were explicitly provided but with `None` values within a
-passed in `**kwargs` dict rather than as passed directly by name. Patch
+conflicting *input* and *stdin* or *capture_output* and *stdout* or *stderr*
+args when they were explicitly provided but with ``None`` values within a
+passed in ``**kwargs`` dict rather than as passed directly by name. Patch
 contributed by RĂ©mi Lapeyre.
 
 ..
@@ -3546,7 +3546,7 @@ Patch by Stein Karlsen.
 .. nonce: XaJDei
 .. section: Library
 
-lib2to3 now recognizes expressions after ``*`` and `**` like in ``f(*[] or
+lib2to3 now recognizes expressions after ``*`` and ``**`` like in ``f(*[] or
 [])``.
 
 ..