Skip to content

Commit

Permalink
[3.10] Docs: Fix backtick errors found by sphinx-lint (GH-97998) (#98373
Browse files Browse the repository at this point in the history
)

Co-authored-by: Ezio Melotti <[email protected]>.
(cherry picked from commit fa2d43e)

Co-authored-by: Hugo van Kemenade <[email protected]>

Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
CAM-Gerlach and hugovk authored Oct 17, 2022
1 parent 3adf234 commit b2db1c2
Show file tree
Hide file tree
Showing 49 changed files with 81 additions and 89 deletions.
2 changes: 1 addition & 1 deletion Doc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Available make targets are:

* "pydoc-topics", which builds a Python module containing a dictionary with
plain text documentation for the labels defined in
`tools/pyspecific.py` -- pydoc needs these to show topic and keyword help.
``tools/pyspecific.py`` -- pydoc needs these to show topic and keyword help.

* "suspicious", which checks the parsed markup for text that looks like
malformed and thus unconverted reST.
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,7 @@ is not possible due to its implementation being opaque at build time.
Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after
first calling :c:func:`PyThread_tss_delete` to ensure any associated
thread locals have been unassigned. This is a no-op if the *key*
argument is `NULL`.
argument is ``NULL``.
.. note::
A freed key becomes a dangling pointer. You should reset the key to
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Type Objects
.. c:function:: unsigned long PyType_GetFlags(PyTypeObject* type)
Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This function is primarily
meant for use with `Py_LIMITED_API`; the individual flag bits are
meant for use with ``Py_LIMITED_API``; the individual flag bits are
guaranteed to be stable across Python releases, but access to
:c:member:`~PyTypeObject.tp_flags` itself is not part of the limited API.
Expand Down
2 changes: 1 addition & 1 deletion Doc/faq/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Why can't I use an assignment in an expression?

Starting in Python 3.8, you can!

Assignment expressions using the walrus operator `:=` assign a variable in an
Assignment expressions using the walrus operator ``:=`` assign a variable in an
expression::

while chunk := fp.read(200):
Expand Down
10 changes: 5 additions & 5 deletions Doc/howto/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,14 @@ raw message. If there is no date format string, the default date format is:
%Y-%m-%d %H:%M:%S
with the milliseconds tacked on at the end. The ``style`` is one of `%`, '{'
or '$'. If one of these is not specified, then '%' will be used.
with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``,
``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be used.

If the ``style`` is '%', the message format string uses
If the ``style`` is ``'%'``, the message format string uses
``%(<dictionary key>)s`` styled string substitution; the possible keys are
documented in :ref:`logrecord-attributes`. If the style is '{', the message
documented in :ref:`logrecord-attributes`. If the style is ``'{'``, the message
format string is assumed to be compatible with :meth:`str.format` (using
keyword arguments), while if the style is '$' then the message format string
keyword arguments), while if the style is ``'$'`` then the message format string
should conform to what is expected by :meth:`string.Template.substitute`.

.. versionchanged:: 3.2
Expand Down
2 changes: 1 addition & 1 deletion Doc/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ And on Windows, the configuration files are:
+--------------+-------------------------------------------------+-------+

On all platforms, the "personal" file can be temporarily disabled by
passing the `--no-user-cfg` option.
passing the ``--no-user-cfg`` option.

Notes:

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/asyncio-protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ accept factories that return streaming protocols.
a connection is open.

However, :meth:`protocol.eof_received() <Protocol.eof_received>`
is called at most once. Once `eof_received()` is called,
is called at most once. Once ``eof_received()`` is called,
``data_received()`` is not called anymore.

.. method:: Protocol.eof_received()
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/asyncio-task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -707,17 +707,17 @@ Running in Threads
# blocking_io complete at 19:50:54
# finished main at 19:50:54

Directly calling `blocking_io()` in any coroutine would block the event loop
Directly calling ``blocking_io()`` in any coroutine would block the event loop
for its duration, resulting in an additional 1 second of run time. Instead,
by using `asyncio.to_thread()`, we can run it in a separate thread without
by using ``asyncio.to_thread()``, we can run it in a separate thread without
blocking the event loop.

.. note::

Due to the :term:`GIL`, `asyncio.to_thread()` can typically only be used
Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used
to make IO-bound functions non-blocking. However, for extension modules
that release the GIL or alternative Python implementations that don't
have one, `asyncio.to_thread()` can also be used for CPU-bound functions.
have one, ``asyncio.to_thread()`` can also be used for CPU-bound functions.

.. versionadded:: 3.9

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/bdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ The :mod:`bdb` module also defines two classes:

For real file names, the canonical form is an operating-system-dependent,
:func:`case-normalized <os.path.normcase>` :func:`absolute path
<os.path.abspath>`. A *filename* with angle brackets, such as `"<stdin>"`
<os.path.abspath>`. A *filename* with angle brackets, such as ``"<stdin>"``
generated in interactive mode, is returned unchanged.

.. method:: reset()
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/bz2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Incremental (de)compression
will be set to ``True``.

Attempting to decompress data after the end of stream is reached
raises an `EOFError`. Any data found after the end of the
raises an :exc:`EOFError`. Any data found after the end of the
stream is ignored and saved in the :attr:`~.unused_data` attribute.

.. versionchanged:: 3.5
Expand Down Expand Up @@ -303,7 +303,7 @@ Using :class:`BZ2Compressor` for incremental compression:
>>> out = out + comp.flush()

The example above uses a very "nonrandom" stream of data
(a stream of `b"z"` chunks). Random data tends to compress poorly,
(a stream of ``b"z"`` chunks). Random data tends to compress poorly,
while ordered, repetitive data usually yields a high compression ratio.

Writing and reading a bzip2-compressed file in binary mode:
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/concurrent.futures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ And::

All threads enqueued to ``ThreadPoolExecutor`` will be joined before the
interpreter can exit. Note that the exit handler which does this is
executed *before* any exit handlers added using `atexit`. This means
executed *before* any exit handlers added using ``atexit``. This means
exceptions in the main thread must be caught and handled in order to
signal threads to exit gracefully. For this reason, it is recommended
that ``ThreadPoolExecutor`` not be used for long-running tasks.
Expand Down Expand Up @@ -398,13 +398,13 @@ The :class:`Future` class encapsulates the asynchronous execution of a callable.
tests.

If the method returns ``False`` then the :class:`Future` was cancelled,
i.e. :meth:`Future.cancel` was called and returned `True`. Any threads
i.e. :meth:`Future.cancel` was called and returned ``True``. Any threads
waiting on the :class:`Future` completing (i.e. through
:func:`as_completed` or :func:`wait`) will be woken up.

If the method returns ``True`` then the :class:`Future` was not cancelled
and has been put in the running state, i.e. calls to
:meth:`Future.running` will return `True`.
:meth:`Future.running` will return ``True``.

This method can only be called once and cannot be called after
:meth:`Future.set_result` or :meth:`Future.set_exception` have been
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ Utility functions
.. function:: GetLastError()

Windows only: Returns the last error code set by Windows in the calling thread.
This function calls the Windows `GetLastError()` function directly,
This function calls the Windows ``GetLastError()`` function directly,
it does not return the ctypes-private copy of the error code.

.. function:: get_errno()
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/curses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ The module :mod:`curses` defines the following functions:
Change the definition of a color, taking the number of the color to be changed
followed by three RGB values (for the amounts of red, green, and blue
components). The value of *color_number* must be between ``0`` and
`COLORS - 1`. Each of *r*, *g*, *b*, must be a value between ``0`` and
``COLORS - 1``. Each of *r*, *g*, *b*, must be a value between ``0`` and
``1000``. When :func:`init_color` is used, all occurrences of that color on the
screen immediately change to the new definition. This function is a no-op on
most terminals; it is active only if :func:`can_change_color` returns ``True``.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,7 @@ where historical changes have been made to civil time.
two digits of ``offset.hours`` and ``offset.minutes`` respectively.

.. versionchanged:: 3.6
Name generated from ``offset=timedelta(0)`` is now plain `'UTC'`, not
Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not
``'UTC+00:00'``.


Expand Down
8 changes: 4 additions & 4 deletions Doc/library/decimal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,11 @@ Decimal objects
Alternative constructor that only accepts instances of :class:`float` or
:class:`int`.

Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`.
Note ``Decimal.from_float(0.1)`` is not the same as ``Decimal('0.1')``.
Since 0.1 is not exactly representable in binary floating point, the
value is stored as the nearest representable value which is
`0x1.999999999999ap-4`. That equivalent value in decimal is
`0.1000000000000000055511151231257827021181583404541015625`.
``0x1.999999999999ap-4``. That equivalent value in decimal is
``0.1000000000000000055511151231257827021181583404541015625``.

.. note:: From Python 3.2 onwards, a :class:`Decimal` instance
can also be constructed directly from a :class:`float`.
Expand Down Expand Up @@ -1193,7 +1193,7 @@ In addition to the three supplied contexts, new contexts can be created with the

.. method:: exp(x)

Returns `e ** x`.
Returns ``e ** x``.


.. method:: fma(x, y, z)
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/email.compat32-message.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Here are the methods of the :class:`Message` class:
In a model generated from bytes, any header values that (in contravention of
the RFCs) contain non-ASCII bytes will, when retrieved through this
interface, be represented as :class:`~email.header.Header` objects with
a charset of `unknown-8bit`.
a charset of ``unknown-8bit``.


.. method:: __len__()
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/email.errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ All defect classes are subclassed from :class:`email.errors.MessageDefect`.
a multiple of 4). The encoded block was kept as-is.

* :class:`InvalidDateDefect` -- When decoding an invalid or unparsable date field.
The original value is kept as-is.
The original value is kept as-is.
2 changes: 1 addition & 1 deletion Doc/library/email.headerregistry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ headers.
specified as ``-0000`` (indicating it is in UTC but contains no
information about the source timezone), then :attr:`.datetime` will be a
naive :class:`~datetime.datetime`. If a specific timezone offset is
found (including `+0000`), then :attr:`.datetime` will contain an aware
found (including ``+0000``), then :attr:`.datetime` will contain an aware
``datetime`` that uses :class:`datetime.timezone` to record the timezone
offset.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/hashlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ Constructor functions also accept the following tree hashing parameters:
BLAKE2s, 0 in sequential mode).

* *last_node*: boolean indicating whether the processed node is the last
one (`False` for sequential mode).
one (``False`` for sequential mode).

.. figure:: hashlib-blake2-tree.png
:alt: Explanation of tree mode parameters.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/lzma.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Compressing and decompressing data in memory
will be set to ``True``.

Attempting to decompress data after the end of stream is reached
raises an `EOFError`. Any data found after the end of the
raises an :exc:`EOFError`. Any data found after the end of the
stream is ignored and saved in the :attr:`~.unused_data` attribute.

.. versionchanged:: 3.5
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3107,7 +3107,7 @@ features:
system records access and modification times; see :func:`~os.stat`. The best
way to preserve exact times is to use the *st_atime_ns* and *st_mtime_ns*
fields from the :func:`os.stat` result object with the *ns* parameter to
`utime`.
:func:`utime`.

This function can support :ref:`specifying a file descriptor <path_fd>`,
:ref:`paths relative to directory descriptors <dir_fd>` and :ref:`not
Expand Down Expand Up @@ -3984,7 +3984,7 @@ written in Python, such as a mail server's external command delivery program.
library :c:data:`POSIX_SPAWN_RESETIDS` flag.

If the *setsid* argument is ``True``, it will create a new session ID
for `posix_spawn`. *setsid* requires :c:data:`POSIX_SPAWN_SETSID`
for ``posix_spawn``. *setsid* requires :c:data:`POSIX_SPAWN_SETSID`
or :c:data:`POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError`
is raised.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/select.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The module defines the following:
events.

*sizehint* informs epoll about the expected number of events to be
registered. It must be positive, or `-1` to use the default. It is only
registered. It must be positive, or ``-1`` to use the default. It is only
used on older systems where :c:func:`epoll_create1` is not available;
otherwise it has no effect (though its value is still checked).

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC`
bit flags are applied to *type* they are cleared, and
:attr:`socket.type` will not reflect them. They are still passed
to the underlying system `socket()` call. Therefore,
to the underlying system ``socket()`` call. Therefore,

::

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ of applications in statistics.
The relative likelihood is computed as the probability of a sample
occurring in a narrow range divided by the width of the range (hence
the word "density"). Since the likelihood is relative to other points,
its value can be greater than `1.0`.
its value can be greater than ``1.0``.

.. method:: NormalDist.cdf(x)

Expand Down
6 changes: 3 additions & 3 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ always available.
Print low-level information to stderr about the state of CPython's memory
allocator.

If Python is `built in debug mode <debug-build>` (:option:`configure
If Python is :ref:`built in debug mode <debug-build>` (:option:`configure
--with-pydebug option <--with-pydebug>`), it also performs some expensive
internal consistency checks.

Expand Down Expand Up @@ -320,7 +320,7 @@ always available.
files to (and read them from) a parallel directory tree rooted at this
directory, rather than from ``__pycache__`` directories in the source code
tree. Any ``__pycache__`` directories in the source code tree will be ignored
and new `.pyc` files written within the pycache prefix. Thus if you use
and new ``.pyc`` files written within the pycache prefix. Thus if you use
:mod:`compileall` as a pre-build step, you must ensure you run it with the
same pycache prefix (if any) that you will use at runtime.

Expand Down Expand Up @@ -828,7 +828,7 @@ always available.
.. function:: get_asyncgen_hooks()

Returns an *asyncgen_hooks* object, which is similar to a
:class:`~collections.namedtuple` of the form `(firstiter, finalizer)`,
:class:`~collections.namedtuple` of the form ``(firstiter, finalizer)``,
where *firstiter* and *finalizer* are expected to be either ``None`` or
functions which take an :term:`asynchronous generator iterator` as an
argument, and are used to schedule finalization of an asynchronous
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/tk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ alternative `GUI frameworks and tools <https://wiki.python.org/moin/GuiProgrammi

.. Other sections I have in mind are
Tkinter internals
Freezing Tkinter applications
Freezing Tkinter applications
2 changes: 1 addition & 1 deletion Doc/library/tkinter.colorchooser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ the :class:`~tkinter.commondialog.Dialog` class.
.. seealso::

Module :mod:`tkinter.commondialog`
Tkinter standard dialog module
Tkinter standard dialog module
2 changes: 1 addition & 1 deletion Doc/library/tkinter.dnd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ Selection of a target object occurs as follows:

.. seealso::

:ref:`Bindings-and-Events`
:ref:`Bindings-and-Events`
2 changes: 1 addition & 1 deletion Doc/library/tkinter.messagebox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ limited to:
askokcancel(title=None, message=None, **options)
askretrycancel(title=None, message=None, **options)
askyesno(title=None, message=None, **options)
askyesnocancel(title=None, message=None, **options)
askyesnocancel(title=None, message=None, **options)
4 changes: 2 additions & 2 deletions Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Standard names are defined for the following types:
The :term:`loader` which loaded the module. Defaults to ``None``.

This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader`
as stored in the attr:`__spec__` object.
as stored in the :attr:`__spec__` object.

.. note::
A future version of Python may stop setting this attribute by default.
Expand All @@ -264,7 +264,7 @@ Standard names are defined for the following types:
:attr:`__name__` if the module is a package itself). Defaults to ``None``.

This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent`
as stored in the attr:`__spec__` object.
as stored in the :attr:`__spec__` object.

.. note::
A future version of Python may stop setting this attribute by default.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/unittest.mock-examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ on first use).
That aside there is a way to use ``mock`` to affect the results of an import.
Importing fetches an *object* from the :data:`sys.modules` dictionary. Note that it
fetches an *object*, which need not be a module. Importing a module for the
first time results in a module object being put in `sys.modules`, so usually
first time results in a module object being put in ``sys.modules``, so usually
when you import something you get a module back. This need not be the case
however.

Expand Down
4 changes: 2 additions & 2 deletions Doc/library/xml.dom.minidom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ module documentation. This section lists the differences between the API and
Similarly, explicitly stating the *standalone* argument causes the
standalone document declarations to be added to the prologue of the XML
document.
If the value is set to `True`, `standalone="yes"` is added,
otherwise it is set to `"no"`.
If the value is set to ``True``, ``standalone="yes"`` is added,
otherwise it is set to ``"no"``.
Not stating the argument will omit the declaration from the document.

.. versionchanged:: 3.8
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/xmlrpc.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ between conformable Python objects and XML on the wire.
may be passed to calls.
The *headers* parameter is an optional sequence of HTTP headers to send with
each request, expressed as a sequence of 2-tuples representing the header
name and value. (e.g. `[('Header-Name', 'value')]`).
name and value. (e.g. ``[('Header-Name', 'value')]``).
The obsolete *use_datetime* flag is similar to *use_builtin_types* but it
applies only to date/time values.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/xmlrpc.server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ This ExampleService demo can be invoked from the command line::


The client that interacts with the above server is included in
`Lib/xmlrpc/client.py`::
``Lib/xmlrpc/client.py``::

server = ServerProxy("http://localhost:8000")

Expand Down
Loading

0 comments on commit b2db1c2

Please sign in to comment.