]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-101100: Fix sphinx warnings in `c-api/file.rst` (GH-114546) (#114584)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 4 Feb 2024 08:57:19 +0000 (09:57 +0100)
committerGitHub <noreply@github.com>
Sun, 4 Feb 2024 08:57:19 +0000 (10:57 +0200)
* gh-101100: Fix sphinx warnings in `c-api/file.rst` (GH-114546)
(cherry picked from commit 01d970c1b8acf3ccf199d5de151a635ffd9d8c61)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Doc/c-api/file.rst
Doc/c-api/object.rst
Doc/tools/.nitignore

index b36c800e00444aca6e79f80efd33eeefdffd41fd..0a03841e467cad94de41a5386ec56f0ae33254b9 100644 (file)
@@ -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
index ebffbe47781fa8f84c7632ffd6366d3df3797c91..2c8ffe57bf4126832b3523a23a971c478474eff4 100644 (file)
@@ -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
index 67b1cc1289642287ba1124b96a6eb15890ecfc06..0eade86133aa6bd7251428a113780d13f25a3158 100644 (file)
@@ -5,7 +5,6 @@
 Doc/c-api/arg.rst
 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