Skip to content

Commit 170bf79

Browse files
miss-islingtonsobolevnhugovk
authored
[3.11] gh-101100: Fix sphinx warnings in c-api/file.rst (GH-114546) (#114585)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 8cff807 commit 170bf79

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

Doc/c-api/file.rst

+7-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ the :mod:`io` APIs instead.
6565
Overrides the normal behavior of :func:`io.open_code` to pass its parameter
6666
through the provided handler.
6767
68-
The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path,
69-
void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
68+
The handler is a function of type:
69+
70+
.. c:type:: Py_OpenCodeHookFunction
71+
72+
Equivalent of :c:expr:`PyObject *(\*)(PyObject *path,
73+
void *userData)`, where *path* is guaranteed to be
74+
:c:type:`PyUnicodeObject`.
7075
7176
The *userData* pointer is passed into the hook function. Since hook
7277
functions may be called from different runtimes, this pointer should not

Doc/c-api/object.rst

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ Object Protocol
1919
to NotImplemented and return it).
2020

2121

22+
.. c:macro:: Py_PRINT_RAW
23+
24+
Flag to be used with multiple functions that print the object (like
25+
:c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`).
26+
If passed, these function would use the :func:`str` of the object
27+
instead of the :func:`repr`.
28+
29+
2230
.. c:function:: int PyObject_Print(PyObject *o, FILE *fp, int flags)
2331
2432
Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument

Doc/tools/.nitignore

-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44

55
Doc/c-api/descriptor.rst
66
Doc/c-api/exceptions.rst
7-
Doc/c-api/file.rst
87
Doc/c-api/float.rst
98
Doc/c-api/gcsupport.rst
109
Doc/c-api/init.rst
1110
Doc/c-api/init_config.rst
1211
Doc/c-api/intro.rst
1312
Doc/c-api/memoryview.rst
1413
Doc/c-api/module.rst
15-
Doc/c-api/object.rst
1614
Doc/c-api/stable.rst
1715
Doc/c-api/structures.rst
1816
Doc/c-api/sys.rst

0 commit comments

Comments
 (0)