Skip to content

Commit 401119a

Browse files
koyuki7whugovk
authored andcommitted
pythongh-101100: Fix sphinx warnings in Doc/library/exceptions.rst (pythonGH-136309)
(cherry picked from commit 0152df5) Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 4a889d8 commit 401119a

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
@@ -586,7 +594,7 @@ The following exceptions are the exceptions that are usually raised.
586594
handled, the Python interpreter exits; no stack traceback is printed. The
587595
constructor accepts the same optional argument passed to :func:`sys.exit`.
588596
If the value is an integer, it specifies the system exit status (passed to
589-
C's :c:func:`exit` function); if it is ``None``, the exit status is zero; if
597+
C's :c:func:`!exit` function); if it is ``None``, the exit status is zero; if
590598
it has another type (such as a string), the object's value is printed and
591599
the exit status is one.
592600

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Doc/library/asyncio-extending.rst
1717
Doc/library/asyncio-policy.rst
1818
Doc/library/email.charset.rst
1919
Doc/library/email.parser.rst
20-
Doc/library/exceptions.rst
2120
Doc/library/functools.rst
2221
Doc/library/http.cookiejar.rst
2322
Doc/library/http.server.rst

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy