summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-01-26 10:02:49 (GMT)
committerGitHub <noreply@github.com>2024-01-26 10:02:49 (GMT)
commit170bf7951e19ad2be608c9a377cecd96ac40e25c (patch)
tree95ece84d88e26e8acf502cde97e262c3b9e63b2d /Doc
parent8cff807ae43dbfa3857a9f0fdf885540291528c9 (diff)
downloadcpython-170bf7951e19ad2be608c9a377cecd96ac40e25c.zip
cpython-170bf7951e19ad2be608c9a377cecd96ac40e25c.tar.gz
cpython-170bf7951e19ad2be608c9a377cecd96ac40e25c.tar.bz2
[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>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/file.rst9
-rw-r--r--Doc/c-api/object.rst8
-rw-r--r--Doc/tools/.nitignore2
3 files changed, 15 insertions, 4 deletions
diff --git a/Doc/c-api/file.rst b/Doc/c-api/file.rst
index b36c800..0a03841 100644
--- a/Doc/c-api/file.rst
+++ b/Doc/c-api/file.rst
@@ -65,8 +65,13 @@ the :mod:`io` APIs instead.
Overrides the normal behavior of :func:`io.open_code` to pass its parameter
through the provided handler.
- The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path,
- void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
+ The handler is a function of type:
+
+ .. 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
functions may be called from different runtimes, this pointer should not
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index 54e9733..32f74fb 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -19,6 +19,14 @@ Object Protocol
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)
Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument
diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore
index eca771d..199c367 100644
--- a/Doc/tools/.nitignore
+++ b/Doc/tools/.nitignore
@@ -4,7 +4,6 @@
Doc/c-api/descriptor.rst
Doc/c-api/exceptions.rst
-Doc/c-api/file.rst
Doc/c-api/float.rst
Doc/c-api/gcsupport.rst
Doc/c-api/init.rst
@@ -12,7 +11,6 @@ Doc/c-api/init_config.rst
Doc/c-api/intro.rst
Doc/c-api/memoryview.rst
Doc/c-api/module.rst
-Doc/c-api/object.rst
Doc/c-api/stable.rst
Doc/c-api/structures.rst
Doc/c-api/sys.rst