Skip to content

Commit d7a7883

Browse files
authored
[3.12] gh-101100: Fix Sphinx reference warnings (GH-112416) (#112420)
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent b478c5e commit d7a7883

File tree

8 files changed

+24
-18
lines changed

8 files changed

+24
-18
lines changed

Doc/c-api/set.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ subtypes but not for instances of :class:`frozenset` or its subtypes.
147147
148148
Return ``1`` if found and removed, ``0`` if not found (no action taken), and ``-1`` if an
149149
error is encountered. Does not raise :exc:`KeyError` for missing keys. Raise a
150-
:exc:`TypeError` if the *key* is unhashable. Unlike the Python :meth:`~set.discard`
150+
:exc:`TypeError` if the *key* is unhashable. Unlike the Python :meth:`~frozenset.discard`
151151
method, this function does not automatically convert unhashable sets into
152152
temporary frozensets. Raise :exc:`SystemError` if *set* is not an
153153
instance of :class:`set` or its subtype.

Doc/extending/newtypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ An interesting advantage of using the :c:member:`~PyTypeObject.tp_members` table
296296
descriptors that are used at runtime is that any attribute defined this way can
297297
have an associated doc string simply by providing the text in the table. An
298298
application can use the introspection API to retrieve the descriptor from the
299-
class object, and get the doc string using its :attr:`__doc__` attribute.
299+
class object, and get the doc string using its :attr:`!__doc__` attribute.
300300

301301
As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry with a :c:member:`~PyMethodDef.ml_name` value
302302
of ``NULL`` is required.
@@ -448,7 +448,7 @@ instance of your data type. Here is a simple example::
448448
return result;
449449
}
450450

451-
:c:type:`Py_hash_t` is a signed integer type with a platform-varying width.
451+
:c:type:`!Py_hash_t` is a signed integer type with a platform-varying width.
452452
Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error,
453453
which is why you should be careful to avoid returning it when hash computation
454454
is successful, as seen above.

Doc/library/asyncio-stream.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ StreamReader
204204
directly; use :func:`open_connection` and :func:`start_server`
205205
instead.
206206

207+
.. method:: feed_eof()
208+
209+
Acknowledge the EOF.
210+
207211
.. coroutinemethod:: read(n=-1)
208212

209213
Read up to *n* bytes from the stream.

Doc/library/email.errors.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ The following exception classes are defined in the :mod:`email.errors` module:
5858
:class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g.
5959
:class:`~email.mime.image.MIMEImage`).
6060

61+
.. exception:: MessageDefect()
62+
63+
This is the base class for all defects found when parsing email messages.
64+
It is derived from :exc:`ValueError`.
65+
66+
.. exception:: HeaderDefect()
67+
68+
This is the base class for all defects found when parsing email headers.
69+
It is derived from :exc:`MessageDefect`.
6170

6271
Here is the list of the defects that the :class:`~email.parser.FeedParser`
6372
can find while parsing messages. Note that the defects are added to the message

Doc/library/gzip.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The module defines the following items:
105105
should only be provided in compression mode. If omitted or ``None``, the
106106
current time is used. See the :attr:`mtime` attribute for more details.
107107

108-
Calling a :class:`GzipFile` object's :meth:`close` method does not close
108+
Calling a :class:`GzipFile` object's :meth:`!close` method does not close
109109
*fileobj*, since you might wish to append more material after the compressed
110110
data. This also allows you to pass an :class:`io.BytesIO` object opened for
111111
writing as *fileobj*, and retrieve the resulting memory buffer using the

Doc/library/importlib.resources.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ for example, a package and its resources can be imported from a zip file using
5050
``get_resource_reader(fullname)`` method as specified by
5151
:class:`importlib.resources.abc.ResourceReader`.
5252

53-
.. data:: Anchor
53+
.. class:: Anchor
5454

5555
Represents an anchor for resources, either a :class:`module object
5656
<types.ModuleType>` or a module name as a string. Defined as
@@ -63,7 +63,7 @@ for example, a package and its resources can be imported from a zip file using
6363
(think files). A Traversable may contain other containers (think
6464
subdirectories).
6565

66-
*anchor* is an optional :data:`Anchor`. If the anchor is a
66+
*anchor* is an optional :class:`Anchor`. If the anchor is a
6767
package, resources are resolved from that package. If a module,
6868
resources are resolved adjacent to that module (in the same package
6969
or the package root). If the anchor is omitted, the caller's module
@@ -72,10 +72,10 @@ for example, a package and its resources can be imported from a zip file using
7272
.. versionadded:: 3.9
7373

7474
.. versionchanged:: 3.12
75-
"package" parameter was renamed to "anchor". "anchor" can now
75+
*package* parameter was renamed to *anchor*. *anchor* can now
7676
be a non-package module and if omitted will default to the caller's
77-
module. "package" is still accepted for compatibility but will raise
78-
a DeprecationWarning. Consider passing the anchor positionally or
77+
module. *package* is still accepted for compatibility but will raise
78+
a :exc:`DeprecationWarning`. Consider passing the anchor positionally or
7979
using ``importlib_resources >= 5.10`` for a compatible interface
8080
on older Pythons.
8181

@@ -96,7 +96,7 @@ for example, a package and its resources can be imported from a zip file using
9696
.. versionadded:: 3.9
9797

9898
.. versionchanged:: 3.12
99-
Added support for ``traversable`` representing a directory.
99+
Added support for *traversable* representing a directory.
100100

101101

102102
Deprecated functions

Doc/library/xml.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ decompression bomb Safe Safe Safe
7373
1. Expat 2.4.1 and newer is not vulnerable to the "billion laughs" and
7474
"quadratic blowup" vulnerabilities. Items still listed as vulnerable due to
7575
potential reliance on system-provided libraries. Check
76-
:const:`pyexpat.EXPAT_VERSION`.
76+
:const:`!pyexpat.EXPAT_VERSION`.
7777
2. :mod:`xml.etree.ElementTree` doesn't expand external entities and raises a
7878
:exc:`~xml.etree.ElementTree.ParseError` when an entity occurs.
7979
3. :mod:`xml.dom.minidom` doesn't expand external entities and simply returns

Doc/tools/.nitignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ Doc/c-api/memory.rst
1515
Doc/c-api/memoryview.rst
1616
Doc/c-api/module.rst
1717
Doc/c-api/object.rst
18-
Doc/c-api/set.rst
1918
Doc/c-api/stable.rst
2019
Doc/c-api/structures.rst
2120
Doc/c-api/sys.rst
2221
Doc/c-api/type.rst
2322
Doc/c-api/typeobj.rst
2423
Doc/extending/extending.rst
25-
Doc/extending/newtypes.rst
2624
Doc/glossary.rst
2725
Doc/howto/descriptor.rst
2826
Doc/howto/enum.rst
@@ -36,7 +34,6 @@ Doc/library/aifc.rst
3634
Doc/library/ast.rst
3735
Doc/library/asyncio-extending.rst
3836
Doc/library/asyncio-policy.rst
39-
Doc/library/asyncio-stream.rst
4037
Doc/library/asyncio-subprocess.rst
4138
Doc/library/asyncio-task.rst
4239
Doc/library/audioop.rst
@@ -59,7 +56,6 @@ Doc/library/decimal.rst
5956
Doc/library/email.charset.rst
6057
Doc/library/email.compat32-message.rst
6158
Doc/library/email.errors.rst
62-
Doc/library/email.headerregistry.rst
6359
Doc/library/email.mime.rst
6460
Doc/library/email.parser.rst
6561
Doc/library/email.policy.rst
@@ -72,12 +68,10 @@ Doc/library/functions.rst
7268
Doc/library/functools.rst
7369
Doc/library/getopt.rst
7470
Doc/library/gettext.rst
75-
Doc/library/gzip.rst
7671
Doc/library/http.client.rst
7772
Doc/library/http.cookiejar.rst
7873
Doc/library/http.cookies.rst
7974
Doc/library/http.server.rst
80-
Doc/library/importlib.resources.rst
8175
Doc/library/importlib.rst
8276
Doc/library/inspect.rst
8377
Doc/library/locale.rst
@@ -139,7 +133,6 @@ Doc/library/xdrlib.rst
139133
Doc/library/xml.dom.minidom.rst
140134
Doc/library/xml.dom.pulldom.rst
141135
Doc/library/xml.dom.rst
142-
Doc/library/xml.rst
143136
Doc/library/xml.sax.handler.rst
144137
Doc/library/xml.sax.reader.rst
145138
Doc/library/xml.sax.rst

0 commit comments

Comments
 (0)