Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.11] gh-93738: Documentation C syntax (:c:type:FILE -> :c:expr:FILE) (GH-97769) #97871

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/c-api/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ File Objects
.. index:: object: file

These APIs are a minimal emulation of the Python 2 C API for built-in file
objects, which used to rely on the buffered I/O (:c:type:`FILE*`) support
objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support
from the C standard library. In Python 3, files and streams use the new
:mod:`io` module, which defines several layers over the low-level unbuffered
I/O of the operating system. The functions described below are
Expand Down
8 changes: 4 additions & 4 deletions Doc/c-api/marshal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The following functions allow marshalled values to be read back in.

.. c:function:: long PyMarshal_ReadLongFromFile(FILE *file)

Return a C :c:type:`long` from the data stream in a :c:type:`FILE*` opened
Return a C :c:type:`long` from the data stream in a :c:expr:`FILE*` opened
for reading. Only a 32-bit value can be read in using this function,
regardless of the native size of :c:type:`long`.

Expand All @@ -53,7 +53,7 @@ The following functions allow marshalled values to be read back in.

.. c:function:: int PyMarshal_ReadShortFromFile(FILE *file)

Return a C :c:type:`short` from the data stream in a :c:type:`FILE*` opened
Return a C :c:type:`short` from the data stream in a :c:expr:`FILE*` opened
for reading. Only a 16-bit value can be read in using this function,
regardless of the native size of :c:type:`short`.

Expand All @@ -63,7 +63,7 @@ The following functions allow marshalled values to be read back in.

.. c:function:: PyObject* PyMarshal_ReadObjectFromFile(FILE *file)

Return a Python object from the data stream in a :c:type:`FILE*` opened for
Return a Python object from the data stream in a :c:expr:`FILE*` opened for
reading.

On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError`
Expand All @@ -72,7 +72,7 @@ The following functions allow marshalled values to be read back in.

.. c:function:: PyObject* PyMarshal_ReadLastObjectFromFile(FILE *file)

Return a Python object from the data stream in a :c:type:`FILE*` opened for
Return a Python object from the data stream in a :c:expr:`FILE*` opened for
reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function
assumes that no further objects will be read from the file, allowing it to
aggressively load file data into memory so that the de-serialization can
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/veryhigh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ parameter. The available start symbols are :const:`Py_eval_input`,
:const:`Py_file_input`, and :const:`Py_single_input`. These are described
following the functions which accept them as parameters.

Note also that several of these functions take :c:type:`FILE*` parameters. One
particular issue which needs to be handled carefully is that the :c:type:`FILE`
Note also that several of these functions take :c:expr:`FILE*` parameters. One
particular issue which needs to be handled carefully is that the :c:expr:`FILE`
structure for different C libraries can be different and incompatible. Under
Windows (at least), it is possible for dynamically linked extensions to actually
use different libraries, so care should be taken that :c:type:`FILE*` parameters
use different libraries, so care should be taken that :c:expr:`FILE*` parameters
are only passed to these functions if it is certain that they were created by
the same library that the Python runtime is using.

Expand Down