Skip to content

Commit b2db1c2

Browse files
CAM-Gerlachhugovk
andauthored
[3.10] Docs: Fix backtick errors found by sphinx-lint (GH-97998) (#98373)
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]>
1 parent 3adf234 commit b2db1c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+81
-89
lines changed

Doc/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Available make targets are:
9191

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

9696
* "suspicious", which checks the parsed markup for text that looks like
9797
malformed and thus unconverted reST.

Doc/c-api/init.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,7 @@ is not possible due to its implementation being opaque at build time.
17221722
Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after
17231723
first calling :c:func:`PyThread_tss_delete` to ensure any associated
17241724
thread locals have been unassigned. This is a no-op if the *key*
1725-
argument is `NULL`.
1725+
argument is ``NULL``.
17261726
17271727
.. note::
17281728
A freed key becomes a dangling pointer. You should reset the key to

Doc/c-api/type.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Type Objects
4040
.. c:function:: unsigned long PyType_GetFlags(PyTypeObject* type)
4141
4242
Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This function is primarily
43-
meant for use with `Py_LIMITED_API`; the individual flag bits are
43+
meant for use with ``Py_LIMITED_API``; the individual flag bits are
4444
guaranteed to be stable across Python releases, but access to
4545
:c:member:`~PyTypeObject.tp_flags` itself is not part of the limited API.
4646

Doc/faq/design.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Why can't I use an assignment in an expression?
155155

156156
Starting in Python 3.8, you can!
157157

158-
Assignment expressions using the walrus operator `:=` assign a variable in an
158+
Assignment expressions using the walrus operator ``:=`` assign a variable in an
159159
expression::
160160

161161
while chunk := fp.read(200):

Doc/howto/logging.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,14 @@ raw message. If there is no date format string, the default date format is:
552552
553553
%Y-%m-%d %H:%M:%S
554554
555-
with the milliseconds tacked on at the end. The ``style`` is one of `%`, '{'
556-
or '$'. If one of these is not specified, then '%' will be used.
555+
with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``,
556+
``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be used.
557557

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

565565
.. versionchanged:: 3.2

Doc/install/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ And on Windows, the configuration files are:
761761
+--------------+-------------------------------------------------+-------+
762762

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

766766
Notes:
767767

Doc/library/asyncio-protocol.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ accept factories that return streaming protocols.
553553
a connection is open.
554554

555555
However, :meth:`protocol.eof_received() <Protocol.eof_received>`
556-
is called at most once. Once `eof_received()` is called,
556+
is called at most once. Once ``eof_received()`` is called,
557557
``data_received()`` is not called anymore.
558558

559559
.. method:: Protocol.eof_received()

Doc/library/asyncio-task.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -707,17 +707,17 @@ Running in Threads
707707
# blocking_io complete at 19:50:54
708708
# finished main at 19:50:54
709709

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

715715
.. note::
716716

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

722722
.. versionadded:: 3.9
723723

Doc/library/bdb.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The :mod:`bdb` module also defines two classes:
143143

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

149149
.. method:: reset()

Doc/library/bz2.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Incremental (de)compression
206206
will be set to ``True``.
207207

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

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

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

309309
Writing and reading a bzip2-compressed file in binary mode:

Doc/library/concurrent.futures.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ And::
151151

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

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

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

409409
This method can only be called once and cannot be called after
410410
:meth:`Future.set_result` or :meth:`Future.set_exception` have been

Doc/library/ctypes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1935,7 +1935,7 @@ Utility functions
19351935
.. function:: GetLastError()
19361936

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

19411941
.. function:: get_errno()

Doc/library/curses.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ The module :mod:`curses` defines the following functions:
292292
Change the definition of a color, taking the number of the color to be changed
293293
followed by three RGB values (for the amounts of red, green, and blue
294294
components). The value of *color_number* must be between ``0`` and
295-
`COLORS - 1`. Each of *r*, *g*, *b*, must be a value between ``0`` and
295+
``COLORS - 1``. Each of *r*, *g*, *b*, must be a value between ``0`` and
296296
``1000``. When :func:`init_color` is used, all occurrences of that color on the
297297
screen immediately change to the new definition. This function is a no-op on
298298
most terminals; it is active only if :func:`can_change_color` returns ``True``.

Doc/library/datetime.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2246,7 +2246,7 @@ where historical changes have been made to civil time.
22462246
two digits of ``offset.hours`` and ``offset.minutes`` respectively.
22472247

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

22522252

Doc/library/decimal.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,11 @@ Decimal objects
576576
Alternative constructor that only accepts instances of :class:`float` or
577577
:class:`int`.
578578

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

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

11941194
.. method:: exp(x)
11951195

1196-
Returns `e ** x`.
1196+
Returns ``e ** x``.
11971197

11981198

11991199
.. method:: fma(x, y, z)

Doc/library/email.compat32-message.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Here are the methods of the :class:`Message` class:
298298
In a model generated from bytes, any header values that (in contravention of
299299
the RFCs) contain non-ASCII bytes will, when retrieved through this
300300
interface, be represented as :class:`~email.header.Header` objects with
301-
a charset of `unknown-8bit`.
301+
a charset of ``unknown-8bit``.
302302

303303

304304
.. method:: __len__()

Doc/library/email.errors.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ All defect classes are subclassed from :class:`email.errors.MessageDefect`.
114114
a multiple of 4). The encoded block was kept as-is.
115115

116116
* :class:`InvalidDateDefect` -- When decoding an invalid or unparsable date field.
117-
The original value is kept as-is.
117+
The original value is kept as-is.

Doc/library/email.headerregistry.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ headers.
153153
specified as ``-0000`` (indicating it is in UTC but contains no
154154
information about the source timezone), then :attr:`.datetime` will be a
155155
naive :class:`~datetime.datetime`. If a specific timezone offset is
156-
found (including `+0000`), then :attr:`.datetime` will contain an aware
156+
found (including ``+0000``), then :attr:`.datetime` will contain an aware
157157
``datetime`` that uses :class:`datetime.timezone` to record the timezone
158158
offset.
159159

Doc/library/hashlib.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ Constructor functions also accept the following tree hashing parameters:
391391
BLAKE2s, 0 in sequential mode).
392392

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

396396
.. figure:: hashlib-blake2-tree.png
397397
:alt: Explanation of tree mode parameters.

Doc/library/lzma.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Compressing and decompressing data in memory
258258
will be set to ``True``.
259259

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

264264
.. versionchanged:: 3.5

Doc/library/os.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -3107,7 +3107,7 @@ features:
31073107
system records access and modification times; see :func:`~os.stat`. The best
31083108
way to preserve exact times is to use the *st_atime_ns* and *st_mtime_ns*
31093109
fields from the :func:`os.stat` result object with the *ns* parameter to
3110-
`utime`.
3110+
:func:`utime`.
31113111

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

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

Doc/library/select.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The module defines the following:
6060
events.
6161

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

Doc/library/socket.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
604604
When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC`
605605
bit flags are applied to *type* they are cleared, and
606606
:attr:`socket.type` will not reflect them. They are still passed
607-
to the underlying system `socket()` call. Therefore,
607+
to the underlying system ``socket()`` call. Therefore,
608608

609609
::
610610

Doc/library/statistics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ of applications in statistics.
786786
The relative likelihood is computed as the probability of a sample
787787
occurring in a narrow range divided by the width of the range (hence
788788
the word "density"). Since the likelihood is relative to other points,
789-
its value can be greater than `1.0`.
789+
its value can be greater than ``1.0``.
790790

791791
.. method:: NormalDist.cdf(x)
792792

Doc/library/sys.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ always available.
250250
Print low-level information to stderr about the state of CPython's memory
251251
allocator.
252252

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

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

@@ -828,7 +828,7 @@ always available.
828828
.. function:: get_asyncgen_hooks()
829829

830830
Returns an *asyncgen_hooks* object, which is similar to a
831-
:class:`~collections.namedtuple` of the form `(firstiter, finalizer)`,
831+
:class:`~collections.namedtuple` of the form ``(firstiter, finalizer)``,
832832
where *firstiter* and *finalizer* are expected to be either ``None`` or
833833
functions which take an :term:`asynchronous generator iterator` as an
834834
argument, and are used to schedule finalization of an asynchronous

Doc/library/tk.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ alternative `GUI frameworks and tools <https://wiki.python.org/moin/GuiProgrammi
4444

4545
.. Other sections I have in mind are
4646
Tkinter internals
47-
Freezing Tkinter applications
47+
Freezing Tkinter applications

Doc/library/tkinter.colorchooser.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ the :class:`~tkinter.commondialog.Dialog` class.
2626
.. seealso::
2727

2828
Module :mod:`tkinter.commondialog`
29-
Tkinter standard dialog module
29+
Tkinter standard dialog module

Doc/library/tkinter.dnd.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ Selection of a target object occurs as follows:
6161

6262
.. seealso::
6363

64-
:ref:`Bindings-and-Events`
64+
:ref:`Bindings-and-Events`

Doc/library/tkinter.messagebox.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ limited to:
3636
askokcancel(title=None, message=None, **options)
3737
askretrycancel(title=None, message=None, **options)
3838
askyesno(title=None, message=None, **options)
39-
askyesnocancel(title=None, message=None, **options)
39+
askyesnocancel(title=None, message=None, **options)

Doc/library/types.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Standard names are defined for the following types:
239239
The :term:`loader` which loaded the module. Defaults to ``None``.
240240

241241
This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader`
242-
as stored in the attr:`__spec__` object.
242+
as stored in the :attr:`__spec__` object.
243243

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

266266
This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent`
267-
as stored in the attr:`__spec__` object.
267+
as stored in the :attr:`__spec__` object.
268268

269269
.. note::
270270
A future version of Python may stop setting this attribute by default.

Doc/library/unittest.mock-examples.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ on first use).
11161116
That aside there is a way to use ``mock`` to affect the results of an import.
11171117
Importing fetches an *object* from the :data:`sys.modules` dictionary. Note that it
11181118
fetches an *object*, which need not be a module. Importing a module for the
1119-
first time results in a module object being put in `sys.modules`, so usually
1119+
first time results in a module object being put in ``sys.modules``, so usually
11201120
when you import something you get a module back. This need not be the case
11211121
however.
11221122

Doc/library/xml.dom.minidom.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ module documentation. This section lists the differences between the API and
148148
Similarly, explicitly stating the *standalone* argument causes the
149149
standalone document declarations to be added to the prologue of the XML
150150
document.
151-
If the value is set to `True`, `standalone="yes"` is added,
152-
otherwise it is set to `"no"`.
151+
If the value is set to ``True``, ``standalone="yes"`` is added,
152+
otherwise it is set to ``"no"``.
153153
Not stating the argument will omit the declaration from the document.
154154

155155
.. versionchanged:: 3.8

Doc/library/xmlrpc.client.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ between conformable Python objects and XML on the wire.
5858
may be passed to calls.
5959
The *headers* parameter is an optional sequence of HTTP headers to send with
6060
each request, expressed as a sequence of 2-tuples representing the header
61-
name and value. (e.g. `[('Header-Name', 'value')]`).
61+
name and value. (e.g. ``[('Header-Name', 'value')]``).
6262
The obsolete *use_datetime* flag is similar to *use_builtin_types* but it
6363
applies only to date/time values.
6464

Doc/library/xmlrpc.server.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ This ExampleService demo can be invoked from the command line::
262262

263263

264264
The client that interacts with the above server is included in
265-
`Lib/xmlrpc/client.py`::
265+
``Lib/xmlrpc/client.py``::
266266

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

0 commit comments

Comments
 (0)