gh-101100: Fix sphinx warnings in c-api/file.rst (#114546)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Nikita Sobolev 2024-01-26 12:55:22 +03:00 committed by GitHub
parent 582d95e8bb
commit 01d970c1b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View file

@ -65,8 +65,13 @@ the :mod:`io` APIs instead.
Overrides the normal behavior of :func:`io.open_code` to pass its parameter Overrides the normal behavior of :func:`io.open_code` to pass its parameter
through the provided handler. through the provided handler.
The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path, The handler is a function of type:
void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
.. c:type:: Py_OpenCodeHookFunction
Equivalent of :c:expr:`PyObject *(\*)(PyObject *path,
void *userData)`, where *path* is guaranteed to be
:c:type:`PyUnicodeObject`.
The *userData* pointer is passed into the hook function. Since hook The *userData* pointer is passed into the hook function. Since hook
functions may be called from different runtimes, this pointer should not functions may be called from different runtimes, this pointer should not

View file

@ -19,6 +19,14 @@ Object Protocol
to NotImplemented and return it). to NotImplemented and return it).
.. c:macro:: Py_PRINT_RAW
Flag to be used with multiple functions that print the object (like
:c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`).
If passed, these function would use the :func:`str` of the object
instead of the :func:`repr`.
.. c:function:: int PyObject_Print(PyObject *o, FILE *fp, int flags) .. c:function:: int PyObject_Print(PyObject *o, FILE *fp, int flags)
Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument

View file

@ -4,7 +4,6 @@
Doc/c-api/descriptor.rst Doc/c-api/descriptor.rst
Doc/c-api/exceptions.rst Doc/c-api/exceptions.rst
Doc/c-api/file.rst
Doc/c-api/float.rst Doc/c-api/float.rst
Doc/c-api/gcsupport.rst Doc/c-api/gcsupport.rst
Doc/c-api/init.rst Doc/c-api/init.rst
@ -12,7 +11,6 @@ Doc/c-api/init_config.rst
Doc/c-api/intro.rst Doc/c-api/intro.rst
Doc/c-api/memoryview.rst Doc/c-api/memoryview.rst
Doc/c-api/module.rst Doc/c-api/module.rst
Doc/c-api/object.rst
Doc/c-api/stable.rst Doc/c-api/stable.rst
Doc/c-api/sys.rst Doc/c-api/sys.rst
Doc/c-api/type.rst Doc/c-api/type.rst