Skip to content

Commit 52e7172

Browse files
authored
Merge branch '3.14' into backport-036d309-3.14
2 parents 093a563 + fd93654 commit 52e7172

57 files changed

Lines changed: 1115 additions & 97 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
# GitHub
88
.github/** @ezio-melotti @hugovk @AA-Turner @webknjaz @StanFromIreland
9-
.github/workflows/jit.yml @savannahostrowski
109
Tools/build/compute-changes.py @AA-Turner @hugovk @webknjaz @StanFromIreland
1110
Lib/test/test_tools/test_compute_changes.py @AA-Turner @hugovk @webknjaz @StanFromIreland
1211

@@ -33,7 +32,7 @@ Lib/test/test_build_details.py @FFY00
3332
**/*context* @1st1
3433
**/*genobject* @markshannon
3534
**/*hamt* @1st1
36-
**/*jit* @brandtbucher @savannahostrowski
35+
**/*jit* @brandtbucher
3736
Python/perf_jit_trampoline.c # Exclude the owners of "**/*jit*", above.
3837
Objects/set* @rhettinger
3938
Objects/dict* @methane @markshannon

‎Doc/c-api/file.rst‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,29 @@ the :mod:`io` APIs instead.
6060
raised if the end of the file is reached immediately.
6161
6262
63+
.. c:function:: char* Py_UniversalNewlineFgets(char *buf, int n, FILE *stream, PyObject *fobj)
64+
65+
Read a line from the C stream *stream* into the buffer *buf*, like the
66+
C standard library function :c:func:`!fgets`, but treating all of ``\n``,
67+
``\r`` and ``\r\n`` as line endings (see :term:`universal newlines`).
68+
Any ``\r`` or ``\r\n`` read from the stream is stored in *buf* as a
69+
single ``\n``.
70+
71+
At most ``n - 1`` characters are stored in *buf*; reading stops after a
72+
newline has been stored or when the end of the file is reached.
73+
The result is always null-terminated.
74+
*stream* should be opened in binary mode, so that the C library does not
75+
perform its own newline translation.
76+
77+
Return *buf* on success.
78+
Return ``NULL`` if no characters could be read, because *stream* is at
79+
end of file, a read error occurred, or *n* is less than 2.
80+
Like :c:func:`!fgets`, this function does not distinguish between end of
81+
file and a read error, and it does not set an exception.
82+
83+
*fobj* exists only for backward compatibility and must be ``NULL``.
84+
85+
6386
.. c:function:: int PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction handler)
6487
6588
Overrides the normal behavior of :func:`io.open_code` to pass its parameter

‎Doc/c-api/float.rst‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ Pack functions
210210
The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an
211211
:c:expr:`int` argument, non-zero if you want the bytes string in little-endian
212212
format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), zero if you
213-
want big-endian format (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN`
214-
constant can be used to use the native endian: it is equal to ``1`` on big
215-
endian processor, or ``0`` on little endian processor.
213+
want big-endian format (exponent first, at *p*). Use the :c:macro:`PY_LITTLE_ENDIAN`
214+
constant to select the native endian: it is equal to ``0`` on big
215+
endian processor, or ``1`` on little endian processor.
216216
217217
Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set,
218218
most likely :exc:`OverflowError`).
@@ -241,8 +241,8 @@ Unpack functions
241241
The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an
242242
:c:expr:`int` argument, non-zero if the bytes string is in little-endian format
243243
(exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-endian
244-
(exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can be used to
245-
use the native endian: it is equal to ``1`` on big endian processor, or ``0``
244+
(exponent first, at *p*). Use the :c:macro:`PY_LITTLE_ENDIAN` constant to
245+
select the native endian: it is equal to ``0`` on big endian processor, or ``1``
246246
on little endian processor.
247247
248248
Return value: The unpacked double. On error, this is ``-1.0`` and

‎Doc/c-api/init_config.rst‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,10 @@ PyConfig
14271427
14281428
See also the :c:member:`~PyConfig.filesystem_errors` member.
14291429
1430+
See also :c:func:`PyUnicode_EncodeFSDefault` and
1431+
:ref:`related functions <capi-filesystem-encoding>`
1432+
for encoding paths at runtime.
1433+
14301434
.. c:member:: wchar_t* filesystem_errors
14311435
14321436
:term:`Filesystem error handler <filesystem encoding and error handler>`:

‎Doc/c-api/intro.rst‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ Numeric utilities
259259
Argument must be a character or an integer in the range [-128, 127] or [0,
260260
255]. This macro returns ``c`` cast to an ``unsigned char``.
261261

262+
.. c:macro:: PY_BIG_ENDIAN
263+
PY_LITTLE_ENDIAN
264+
265+
Constants describing the byte order of the platform that Python was built
266+
for. Exactly one of them is ``1`` and the other is ``0``.
267+
262268

263269
Assertion utilities
264270
^^^^^^^^^^^^^^^^^^^
@@ -820,8 +826,13 @@ use them.
820826
821827
A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``.
822828
C99 doesn't define such a thing directly (size_t is an unsigned integral type).
823-
See :pep:`353` for details. ``PY_SSIZE_T_MAX`` is the largest positive value
824-
of type :c:type:`Py_ssize_t`.
829+
See :pep:`353` for details.
830+
831+
.. c:macro:: PY_SSIZE_T_MAX
832+
PY_SSIZE_T_MIN
833+
834+
The limit values (largest positive one and smallest negative one,
835+
respecitvely) of type :c:type:`Py_ssize_t`.
825836

826837

827838
.. _api-exceptions:

‎Doc/c-api/structures.rst‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,11 +725,20 @@ The following flags can be used with :c:member:`PyMemberDef.flags`:
725725
.. versionchanged:: 3.12
726726
727727
The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`.
728-
The :c:macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix.
728+
The :c:macro:`PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix.
729729
The new names are now always available.
730730
Previously, these required ``#include "structmember.h"``.
731731
The header is still available and it provides the old names.
732732
733+
.. c:macro:: PY_AUDIT_READ
734+
735+
Soft-deprecated alias of :c:macro:`Py_AUDIT_READ` (note capitalization of
736+
the ``y``).
737+
Only available with ``#include "structmember.h"``.
738+
739+
.. soft-deprecated:: 3.12
740+
Use :c:macro:`Py_AUDIT_READ` instead.
741+
733742
.. _PyMemberDef-types:
734743
735744
Member types

‎Doc/c-api/unicode.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,8 @@ system.
915915
used for ``strict``.
916916
917917
918+
.. _capi-filesystem-encoding:
919+
918920
File System Encoding
919921
""""""""""""""""""""
920922

0 commit comments

Comments
 (0)