Skip to content

Commit c3ebffa

Browse files
committed
pythongh-106948: Doc config ignores more standard C functions
Complete nitpick_ignore list in Doc/conf.py to ignore more standard C functions, variables, macros, and also Win32 API functions and macros.
1 parent b1de380 commit c3ebffa

File tree

8 files changed

+93
-17
lines changed

8 files changed

+93
-17
lines changed

Doc/c-api/exceptions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ For convenience, some of these functions will always return a
163163
This is a convenience function to raise an exception when a C library function
164164
has returned an error and set the C variable :c:data:`errno`. It constructs a
165165
tuple object whose first item is the integer :c:data:`errno` value and whose
166-
second item is the corresponding error message (gotten from :c:func:`!strerror`),
166+
second item is the corresponding error message (gotten from :c:func:`strerror`),
167167
and then calls ``PyErr_SetObject(type, object)``. On Unix, when the
168168
:c:data:`errno` value is :c:macro:`EINTR`, indicating an interrupted system call,
169169
this calls :c:func:`PyErr_CheckSignals`, and if that set the error indicator,
@@ -370,7 +370,7 @@ an error value).
370370
.. c:function:: int PyErr_ResourceWarning(PyObject *source, Py_ssize_t stack_level, const char *format, ...)
371371
372372
Function similar to :c:func:`PyErr_WarnFormat`, but *category* is
373-
:exc:`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`.
373+
:exc:`ResourceWarning` and it passes *source* to :func:`!warnings.WarningMessage`.
374374
375375
.. versionadded:: 3.6
376376

Doc/c-api/sys.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,24 @@ Operating System Utilities
9797
.. c:function:: int PyOS_CheckStack()
9898
9999
Return true when the interpreter runs out of stack space. This is a reliable
100-
check, but is only available when :c:macro:`USE_STACKCHECK` is defined (currently
100+
check, but is only available when :c:macro:`!USE_STACKCHECK` is defined (currently
101101
on certain versions of Windows using the Microsoft Visual C++ compiler).
102-
:c:macro:`USE_STACKCHECK` will be defined automatically; you should never
102+
:c:macro:`!USE_STACKCHECK` will be defined automatically; you should never
103103
change the definition in your own code.
104104
105105
106106
.. c:function:: PyOS_sighandler_t PyOS_getsig(int i)
107107
108108
Return the current signal handler for signal *i*. This is a thin wrapper around
109-
either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those functions
109+
either :c:func:`sigaction` or :c:func:`signal`. Do not call those functions
110110
directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:expr:`void
111111
(\*)(int)`.
112112
113113
114114
.. c:function:: PyOS_sighandler_t PyOS_setsig(int i, PyOS_sighandler_t h)
115115
116116
Set the signal handler for signal *i* to be *h*; return the old signal handler.
117-
This is a thin wrapper around either :c:func:`!sigaction` or :c:func:`!signal`. Do
117+
This is a thin wrapper around either :c:func:`sigaction` or :c:func:`signal`. Do
118118
not call those functions directly! :c:type:`PyOS_sighandler_t` is a typedef
119119
alias for :c:expr:`void (\*)(int)`.
120120

Doc/conf.py

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,43 +78,119 @@
7878

7979
nitpick_ignore = [
8080
# Standard C functions
81+
('c:func', '_exit'),
82+
('c:func', '_stricmp'),
83+
('c:func', 'abort'),
84+
('c:func', 'atof'),
8185
('c:func', 'calloc'),
86+
('c:func', 'close'),
87+
('c:func', 'ctime'),
8288
('c:func', 'dlopen'),
8389
('c:func', 'exec'),
90+
('c:func', 'exit'),
8491
('c:func', 'fcntl'),
92+
('c:func', 'flock'),
8593
('c:func', 'fork'),
8694
('c:func', 'free'),
95+
('c:func', 'fstat'),
96+
('c:func', 'fsync'),
97+
('c:func', 'getsid'),
98+
('c:func', 'gettimeofday'),
8799
('c:func', 'gmtime'),
100+
('c:func', 'inet_aton'),
101+
('c:func', 'inet_pton'),
102+
('c:func', 'ioctl'),
103+
('c:func', 'localeconv'),
88104
('c:func', 'localtime'),
105+
('c:func', 'lockf'),
106+
('c:func', 'lstat'),
89107
('c:func', 'main'),
90108
('c:func', 'malloc'),
109+
('c:func', 'memcpy'),
110+
('c:func', 'memmove'),
111+
('c:func', 'mktime'),
112+
('c:func', 'mmap'),
113+
('c:func', 'munmap'),
114+
('c:func', 'open'),
115+
('c:func', 'perror'),
116+
('c:func', 'posix_spawn'),
117+
('c:func', 'posix_spawn_file_actions_addclose'),
118+
('c:func', 'posix_spawn_file_actions_adddup2'),
119+
('c:func', 'posix_spawn_file_actions_addopen'),
120+
('c:func', 'posix_spawnp'),
91121
('c:func', 'printf'),
122+
('c:func', 'putenv'),
123+
('c:func', 'qsort'),
92124
('c:func', 'realloc'),
125+
('c:func', 'select'),
126+
('c:func', 'setenv'),
127+
('c:func', 'setpgid'),
128+
('c:func', 'setpgrp'),
129+
('c:func', 'setsid'),
130+
('c:func', 'setsockopt'),
131+
('c:func', 'sigaction'),
132+
('c:func', 'sigaltstack'),
133+
('c:func', 'siginterrupt'),
134+
('c:func', 'signal'),
93135
('c:func', 'snprintf'),
136+
('c:func', 'splice'),
94137
('c:func', 'sprintf'),
95138
('c:func', 'stat'),
139+
('c:func', 'statvfs'),
140+
('c:func', 'strcasecmp'),
141+
('c:func', 'strcmp'),
142+
('c:func', 'strerror'),
143+
('c:func', 'strlen'),
144+
('c:func', 'strncmp'),
96145
('c:func', 'system'),
146+
('c:func', 'unsetenv'),
97147
('c:func', 'vsnprintf'),
148+
('c:func', 'vsprintf'),
149+
98150
# Standard C types
99151
('c:type', 'FILE'),
100-
('c:type', '__int'),
152+
('c:type', 'int64_t'),
101153
('c:type', 'intmax_t'),
102154
('c:type', 'off_t'),
103155
('c:type', 'ptrdiff_t'),
104156
('c:type', 'siginfo_t'),
105157
('c:type', 'size_t'),
106158
('c:type', 'ssize_t'),
107159
('c:type', 'time_t'),
160+
('c:type', 'uint64_t'),
108161
('c:type', 'uintmax_t'),
162+
('c:type', 'uintptr_t'),
109163
('c:type', 'va_list'),
164+
('c:type', 'wchar'),
110165
('c:type', 'wchar_t'),
166+
111167
# Standard C macros
168+
('c:macro', 'EDOM'),
169+
('c:macro', 'EINTR'),
112170
('c:macro', 'LLONG_MAX'),
113171
('c:macro', 'LLONG_MIN'),
114172
('c:macro', 'LONG_MAX'),
115173
('c:macro', 'LONG_MIN'),
174+
116175
# Standard C variables
117176
('c:data', 'errno'),
177+
178+
# Win32 API functions
179+
('c:func', 'FormatMessage'),
180+
('c:func', 'GetFileInformationByHandle'),
181+
('c:func', 'GetLastError'),
182+
('c:func', 'GetVersionEx'),
183+
('c:func', 'MessageBeep'),
184+
('c:func', 'PlaySound'),
185+
('c:func', 'ShellExecute'),
186+
('c:func', 'TerminateProcess'),
187+
('c:func', 'VirtualAlloc'),
188+
('c:func', 'VirtualFree'),
189+
('c:func', 'WSAIoctl'),
190+
191+
# Win32 API macros
192+
('c:macro', 'CP_ACP'),
193+
118194
# Standard environment variables
119195
('envvar', 'BROWSER'),
120196
('envvar', 'COLUMNS'),

Doc/library/mailbox.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF.
477477
unlock()
478478

479479
Three locking mechanisms are used---dot locking and, if available, the
480-
:c:func:`!flock` and :c:func:`!lockf` system calls.
480+
:c:func:`flock` and :c:func:`lockf` system calls.
481481

482482

483483
.. seealso::
@@ -588,7 +588,7 @@ Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF.
588588
unlock()
589589

590590
Three locking mechanisms are used---dot locking and, if available, the
591-
:c:func:`!flock` and :c:func:`!lockf` system calls. For MH mailboxes, locking
591+
:c:func:`flock` and :c:func:`lockf` system calls. For MH mailboxes, locking
592592
the mailbox means locking the :file:`.mh_sequences` file and, only for the
593593
duration of any operations that affect them, locking individual message
594594
files.
@@ -686,7 +686,7 @@ Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF.
686686
unlock()
687687

688688
Three locking mechanisms are used---dot locking and, if available, the
689-
:c:func:`!flock` and :c:func:`!lockf` system calls.
689+
:c:func:`flock` and :c:func:`lockf` system calls.
690690

691691

692692
.. seealso::
@@ -737,7 +737,7 @@ Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF.
737737
unlock()
738738

739739
Three locking mechanisms are used---dot locking and, if available, the
740-
:c:func:`!flock` and :c:func:`!lockf` system calls.
740+
:c:func:`flock` and :c:func:`lockf` system calls.
741741

742742

743743
.. seealso::

Doc/library/os.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,14 +714,14 @@ process and user.
714714

715715
.. function:: getsid(pid, /)
716716

717-
Call the system call :c:func:`!getsid`. See the Unix manual for the semantics.
717+
Call the system call :c:func:`getsid`. See the Unix manual for the semantics.
718718

719719
.. availability:: Unix, not Emscripten, not WASI.
720720

721721

722722
.. function:: setsid()
723723

724-
Call the system call :c:func:`!setsid`. See the Unix manual for the semantics.
724+
Call the system call :c:func:`setsid`. See the Unix manual for the semantics.
725725

726726
.. availability:: Unix, not Emscripten, not WASI.
727727

@@ -739,7 +739,7 @@ process and user.
739739
.. function:: strerror(code, /)
740740

741741
Return the error message corresponding to the error code in *code*.
742-
On platforms where :c:func:`!strerror` returns ``NULL`` when given an unknown
742+
On platforms where :c:func:`strerror` returns ``NULL`` when given an unknown
743743
error number, :exc:`ValueError` is raised.
744744

745745

Doc/library/signal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ The :mod:`signal` module defines the following functions:
562562

563563
Note that installing a signal handler with :func:`signal` will reset the
564564
restart behaviour to interruptible by implicitly calling
565-
:c:func:`!siginterrupt` with a true *flag* value for the given signal.
565+
:c:func:`siginterrupt` with a true *flag* value for the given signal.
566566

567567

568568
.. function:: signal(signalnum, handler)

Doc/whatsnew/2.6.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2982,7 +2982,7 @@ Changes to Python's build process and to the C API include:
29822982

29832983
* Python now must be compiled with C89 compilers (after 19
29842984
years!). This means that the Python source tree has dropped its
2985-
own implementations of :c:func:`!memmove` and :c:func:`!strerror`, which
2985+
own implementations of :c:func:`memmove` and :c:func:`strerror`, which
29862986
are in the C89 standard library.
29872987

29882988
* Python 2.6 can be built with Microsoft Visual Studio 2008 (version

Misc/NEWS.d/3.10.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ format string in f-string and :meth:`str.format`.
229229
230230
The implementation of :func:`signal.siginterrupt` now uses
231231
:c:func:`!sigaction` (if it is available in the system) instead of the
232-
deprecated :c:func:`!siginterrupt`. Patch by Pablo Galindo.
232+
deprecated :c:func:`siginterrupt`. Patch by Pablo Galindo.
233233

234234
..
235235

0 commit comments

Comments
 (0)