Skip to content

Commit fc657d0

Browse files
authored
[3.11] gh-101100: Fix Sphinx reference warnings (GH-112416) (#112422)
1 parent 49005e4 commit fc657d0

File tree

8 files changed

+20
-14
lines changed

8 files changed

+20
-14
lines changed

Doc/c-api/set.rst

+1-1
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ An interesting advantage of using the :c:member:`~PyTypeObject.tp_members` table
321321
descriptors that are used at runtime is that any attribute defined this way can
322322
have an associated doc string simply by providing the text in the table. An
323323
application can use the introspection API to retrieve the descriptor from the
324-
class object, and get the doc string using its :attr:`__doc__` attribute.
324+
class object, and get the doc string using its :attr:`!__doc__` attribute.
325325

326326
As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry with a :c:member:`~PyMethodDef.ml_name` value
327327
of ``NULL`` is required.
@@ -473,7 +473,7 @@ instance of your data type. Here is a simple example::
473473
return result;
474474
}
475475

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

Doc/library/asyncio-stream.rst

+4
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

+9
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

+1-1
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ for example, a package and its resources can be imported from a zip file using
4141
``get_resource_reader(fullname)`` method as specified by
4242
:class:`importlib.resources.abc.ResourceReader`.
4343

44-
.. data:: Package
44+
.. class:: Package
4545

4646
Whenever a function accepts a ``Package`` argument, you can pass in
4747
either a :class:`module object <types.ModuleType>` or a module name
@@ -58,7 +58,7 @@ for example, a package and its resources can be imported from a zip file using
5858
containers (think subdirectories).
5959

6060
*package* is either a name or a module object which conforms to the
61-
:data:`Package` requirements.
61+
:class:`Package` requirements.
6262

6363
.. versionadded:: 3.9
6464

Doc/library/xml.rst

+1-1
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

-7
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ Doc/c-api/memory.rst
1414
Doc/c-api/memoryview.rst
1515
Doc/c-api/module.rst
1616
Doc/c-api/object.rst
17-
Doc/c-api/set.rst
1817
Doc/c-api/stable.rst
1918
Doc/c-api/structures.rst
2019
Doc/c-api/sys.rst
2120
Doc/c-api/type.rst
2221
Doc/c-api/typeobj.rst
2322
Doc/extending/extending.rst
24-
Doc/extending/newtypes.rst
2523
Doc/glossary.rst
2624
Doc/howto/descriptor.rst
2725
Doc/howto/enum.rst
@@ -33,7 +31,6 @@ Doc/library/abc.rst
3331
Doc/library/ast.rst
3432
Doc/library/asyncio-extending.rst
3533
Doc/library/asyncio-policy.rst
36-
Doc/library/asyncio-stream.rst
3734
Doc/library/asyncio-subprocess.rst
3835
Doc/library/asyncio-task.rst
3936
Doc/library/bdb.rst
@@ -55,7 +52,6 @@ Doc/library/dis.rst
5552
Doc/library/email.charset.rst
5653
Doc/library/email.compat32-message.rst
5754
Doc/library/email.errors.rst
58-
Doc/library/email.headerregistry.rst
5955
Doc/library/email.mime.rst
6056
Doc/library/email.parser.rst
6157
Doc/library/email.policy.rst
@@ -67,12 +63,10 @@ Doc/library/ftplib.rst
6763
Doc/library/functions.rst
6864
Doc/library/functools.rst
6965
Doc/library/gettext.rst
70-
Doc/library/gzip.rst
7166
Doc/library/http.client.rst
7267
Doc/library/http.cookiejar.rst
7368
Doc/library/http.cookies.rst
7469
Doc/library/http.server.rst
75-
Doc/library/importlib.resources.rst
7670
Doc/library/importlib.rst
7771
Doc/library/inspect.rst
7872
Doc/library/locale.rst
@@ -126,7 +120,6 @@ Doc/library/wsgiref.rst
126120
Doc/library/xml.dom.minidom.rst
127121
Doc/library/xml.dom.pulldom.rst
128122
Doc/library/xml.dom.rst
129-
Doc/library/xml.rst
130123
Doc/library/xml.sax.handler.rst
131124
Doc/library/xml.sax.reader.rst
132125
Doc/library/xml.sax.rst

0 commit comments

Comments
 (0)