File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,29 @@ the :mod:`io` APIs instead.
9393 .. versionadded :: 3.8
9494
9595
96+ .. c :function :: PyObject *PyFile_OpenCodeObject (PyObject *path)
97+
98+ Open *path * with the mode ``'rb' ``. *path * must be a Python :class: `str `
99+ object. The behavior of this function may be overridden by
100+ :c:func: `PyFile_SetOpenCodeHook ` to allow for some preprocessing of the
101+ text.
102+
103+ This is analogous to :func: `io.open_code ` in Python.
104+
105+ On success, this function returns a :term: `strong reference ` to a Python
106+ file object. On failure, this function returns ``NULL `` with an exception
107+ set.
108+
109+ .. versionadded :: 3.8
110+
111+
112+ .. c :function :: PyObject *PyFile_OpenCode (const char *path)
113+
114+ Similar to :c:func: `PyFile_OpenCodeObject `, but *path * is a
115+ UTF-8 encoded :c:expr: `const char* `.
116+
117+ .. versionadded :: 3.8
118+
96119
97120.. c :function :: int PyFile_WriteObject (PyObject *obj, PyObject *p, int flags)
98121
You can’t perform that action at this time.
0 commit comments