Skip to content
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

gh-107298: Add standard exceptions and warnings in the nitpick_ignore list #108029

Merged
Merged
Changes from 1 commit
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
71 changes: 71 additions & 0 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,77 @@
('envvar', 'USER'),
('envvar', 'USERNAME'),
('envvar', 'USERPROFILE'),
]

# Temporary undocumented names.
# In future this list must be empty.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fix would be to replace :c:data:`Exception` with .. c:data:`Exception` in Doc/c-api/exceptions.rst, right?

Copy link
Member Author

@serhiy-storchaka serhiy-storchaka Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this, and it turned out not so simple. You need to specify the type:

.. c:var:: PyObject *PyExc_SomeError

and the result does not look good.

nitpick_ignore = [
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
# C API: Standard Python exception classes
('c:data', 'PyExc_ArithmeticError'),
('c:data', 'PyExc_AssertionError'),
('c:data', 'PyExc_AttributeError'),
('c:data', 'PyExc_BaseException'),
('c:data', 'PyExc_BlockingIOError'),
('c:data', 'PyExc_BrokenPipeError'),
('c:data', 'PyExc_BufferError'),
('c:data', 'PyExc_ChildProcessError'),
('c:data', 'PyExc_ConnectionAbortedError'),
('c:data', 'PyExc_ConnectionError'),
('c:data', 'PyExc_ConnectionRefusedError'),
('c:data', 'PyExc_ConnectionResetError'),
('c:data', 'PyExc_EOFError'),
('c:data', 'PyExc_Exception'),
('c:data', 'PyExc_FileExistsError'),
('c:data', 'PyExc_FileNotFoundError'),
('c:data', 'PyExc_FloatingPointError'),
('c:data', 'PyExc_GeneratorExit'),
('c:data', 'PyExc_ImportError'),
('c:data', 'PyExc_IndentationError'),
('c:data', 'PyExc_IndexError'),
('c:data', 'PyExc_InterruptedError'),
('c:data', 'PyExc_IsADirectoryError'),
('c:data', 'PyExc_KeyboardInterrupt'),
('c:data', 'PyExc_KeyError'),
('c:data', 'PyExc_LookupError'),
('c:data', 'PyExc_MemoryError'),
('c:data', 'PyExc_ModuleNotFoundError'),
('c:data', 'PyExc_NameError'),
('c:data', 'PyExc_NotADirectoryError'),
('c:data', 'PyExc_NotImplementedError'),
('c:data', 'PyExc_OSError'),
('c:data', 'PyExc_OverflowError'),
('c:data', 'PyExc_PermissionError'),
('c:data', 'PyExc_ProcessLookupError'),
('c:data', 'PyExc_RecursionError'),
('c:data', 'PyExc_ReferenceError'),
('c:data', 'PyExc_RuntimeError'),
('c:data', 'PyExc_StopAsyncIteration'),
('c:data', 'PyExc_StopIteration'),
('c:data', 'PyExc_SyntaxError'),
('c:data', 'PyExc_SystemError'),
('c:data', 'PyExc_SystemExit'),
('c:data', 'PyExc_TabError'),
('c:data', 'PyExc_TimeoutError'),
('c:data', 'PyExc_TypeError'),
('c:data', 'PyExc_UnboundLocalError'),
('c:data', 'PyExc_UnicodeDecodeError'),
('c:data', 'PyExc_UnicodeEncodeError'),
('c:data', 'PyExc_UnicodeError'),
('c:data', 'PyExc_UnicodeTranslateError'),
('c:data', 'PyExc_ValueError'),
('c:data', 'PyExc_ZeroDivisionError'),
# C API: Standard Python warning classes
('c:data', 'PyExc_BytesWarning'),
('c:data', 'PyExc_DeprecationWarning'),
('c:data', 'PyExc_FutureWarning'),
('c:data', 'PyExc_ImportWarning'),
('c:data', 'PyExc_PendingDeprecationWarning'),
('c:data', 'PyExc_ResourceWarning'),
('c:data', 'PyExc_RuntimeWarning'),
('c:data', 'PyExc_SyntaxWarning'),
('c:data', 'PyExc_UnicodeWarning'),
('c:data', 'PyExc_UserWarning'),
('c:data', 'PyExc_Warning'),
# Do not error nit-picky mode builds when _SubParsersAction.add_parser cannot
# be resolved, as the method is currently undocumented. For context, see
# https://github.com/python/cpython/pull/103289.
Expand Down