Skip to content

Commit 0152df5

Browse files
koyuki7whugovk
andauthored
gh-101100: Fix sphinx warnings in Doc/library/exceptions.rst (#136309)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent db699db commit 0152df5

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

Doc/library/exceptions.rst

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,24 @@ The following exceptions are the exceptions that are usually raised.
204204
assignment fails. (When an object does not support attribute references or
205205
attribute assignments at all, :exc:`TypeError` is raised.)
206206

207-
The :attr:`name` and :attr:`obj` attributes can be set using keyword-only
208-
arguments to the constructor. When set they represent the name of the attribute
209-
that was attempted to be accessed and the object that was accessed for said
210-
attribute, respectively.
207+
The optional *name* and *obj* keyword-only arguments
208+
set the corresponding attributes:
209+
210+
.. attribute:: name
211+
212+
The name of the attribute that was attempted to be accessed.
213+
214+
.. attribute:: obj
215+
216+
The object that was accessed for the named attribute.
211217

212218
.. versionchanged:: 3.10
213219
Added the :attr:`name` and :attr:`obj` attributes.
214220

215221
.. exception:: EOFError
216222

217223
Raised when the :func:`input` function hits an end-of-file condition (EOF)
218-
without reading any data. (N.B.: the :meth:`io.IOBase.read` and
224+
without reading any data. (Note: the :meth:`!io.IOBase.read` and
219225
:meth:`io.IOBase.readline` methods return an empty string when they hit EOF.)
220226

221227

@@ -312,9 +318,11 @@ The following exceptions are the exceptions that are usually raised.
312318
unqualified names. The associated value is an error message that includes the
313319
name that could not be found.
314320

315-
The :attr:`name` attribute can be set using a keyword-only argument to the
316-
constructor. When set it represent the name of the variable that was attempted
317-
to be accessed.
321+
The optional *name* keyword-only argument sets the attribute:
322+
323+
.. attribute:: name
324+
325+
The name of the variable that was attempted to be accessed.
318326

319327
.. versionchanged:: 3.10
320328
Added the :attr:`name` attribute.
@@ -382,7 +390,7 @@ The following exceptions are the exceptions that are usually raised.
382390

383391
The corresponding error message, as provided by
384392
the operating system. It is formatted by the C
385-
functions :c:func:`perror` under POSIX, and :c:func:`FormatMessage`
393+
functions :c:func:`!perror` under POSIX, and :c:func:`!FormatMessage`
386394
under Windows.
387395

388396
.. attribute:: filename
@@ -398,7 +406,7 @@ The following exceptions are the exceptions that are usually raised.
398406
.. versionchanged:: 3.3
399407
:exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`,
400408
:exc:`socket.error`, :exc:`select.error` and
401-
:exc:`mmap.error` have been merged into :exc:`OSError`, and the
409+
:exc:`!mmap.error` have been merged into :exc:`OSError`, and the
402410
constructor may return a subclass.
403411

404412
.. versionchanged:: 3.4
@@ -597,7 +605,7 @@ The following exceptions are the exceptions that are usually raised.
597605
handled, the Python interpreter exits; no stack traceback is printed. The
598606
constructor accepts the same optional argument passed to :func:`sys.exit`.
599607
If the value is an integer, it specifies the system exit status (passed to
600-
C's :c:func:`exit` function); if it is ``None``, the exit status is zero; if
608+
C's :c:func:`!exit` function); if it is ``None``, the exit status is zero; if
601609
it has another type (such as a string), the object's value is printed and
602610
the exit status is one.
603611

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Doc/library/ast.rst
1616
Doc/library/asyncio-extending.rst
1717
Doc/library/email.charset.rst
1818
Doc/library/email.parser.rst
19-
Doc/library/exceptions.rst
2019
Doc/library/functools.rst
2120
Doc/library/http.cookiejar.rst
2221
Doc/library/http.server.rst

0 commit comments

Comments
 (0)