Skip to content

gh-101100: Fix sphinx warnings in Doc/library/exceptions.rst #136309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions Doc/library/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,24 @@ The following exceptions are the exceptions that are usually raised.
assignment fails. (When an object does not support attribute references or
attribute assignments at all, :exc:`TypeError` is raised.)

The :attr:`name` and :attr:`obj` attributes can be set using keyword-only
arguments to the constructor. When set they represent the name of the attribute
that was attempted to be accessed and the object that was accessed for said
attribute, respectively.
The optional *name* and *obj* keyword-only arguments
set the corresponding attributes:

.. attribute:: name

The name of the attribute that was attempted to be accessed.

.. attribute:: obj

The object that was accessed for the named attribute.

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

.. exception:: EOFError

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


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

The :attr:`name` attribute can be set using a keyword-only argument to the
constructor. When set it represent the name of the variable that was attempted
to be accessed.
The optional *name* keyword-only argument sets the attribute:

.. attribute:: name

The name of the variable that was attempted to be accessed.

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

The corresponding error message, as provided by
the operating system. It is formatted by the C
functions :c:func:`perror` under POSIX, and :c:func:`FormatMessage`
functions :c:func:`!perror` under POSIX, and :c:func:`!FormatMessage`
under Windows.

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

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

Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Doc/library/asyncio-extending.rst
Doc/library/email.charset.rst
Doc/library/email.compat32-message.rst
Doc/library/email.parser.rst
Doc/library/exceptions.rst
Doc/library/functools.rst
Doc/library/http.cookiejar.rst
Doc/library/http.server.rst
Expand Down
Loading