Skip to content

Commit

Permalink
Merge branch 'main' into split
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel authored Sep 6, 2024
2 parents 4719185 + e959848 commit 75f8ff6
Show file tree
Hide file tree
Showing 89 changed files with 2,088 additions and 1,094 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ jobs:
strategy:
fail-fast: false
matrix:
openssl_ver: [1.1.1w, 3.0.13, 3.1.5, 3.2.1]
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
Expand Down Expand Up @@ -266,7 +266,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
env:
OPENSSL_VER: 3.0.13
OPENSSL_VER: 3.0.15
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -380,7 +380,7 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 3.0.13
OPENSSL_VER: 3.0.15
PYTHONSTRICTEXTENSIONBUILD: 1
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-22.04
env:
FORCE_COLOR: 1
OPENSSL_VER: 3.0.13
OPENSSL_VER: 3.0.15
PYTHONSTRICTEXTENSIONBUILD: 1
TERM: linux
steps:
Expand Down
2 changes: 1 addition & 1 deletion Android/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def make_build_python(context):

def unpack_deps(host):
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download"
for name_ver in ["bzip2-1.0.8-1", "libffi-3.4.4-2", "openssl-3.0.13-1",
for name_ver in ["bzip2-1.0.8-1", "libffi-3.4.4-2", "openssl-3.0.15-0",
"sqlite-3.45.1-0", "xz-5.4.6-0"]:
filename = f"{name_ver}-{host}.tar.gz"
download(f"{deps_url}/{name_ver}/{filename}")
Expand Down
22 changes: 21 additions & 1 deletion Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ PyPreConfig
* Set :c:member:`PyConfig.filesystem_encoding` to ``"mbcs"``,
* Set :c:member:`PyConfig.filesystem_errors` to ``"replace"``.
Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment
Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment
variable value.
Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for
Expand Down Expand Up @@ -1744,6 +1744,26 @@ only implemented when ``Py_InitializeFromInitConfig()`` is called, not by the
* Set an error in *config* and return ``-1`` on error.
Module
------
.. c:function:: int PyInitConfig_AddModule(PyInitConfig *config, const char *name, PyObject* (*initfunc)(void))
Add a built-in extension module to the table of built-in modules.
The new module can be imported by the name *name*, and uses the function
*initfunc* as the initialization function called on the first attempted
import.
* Return ``0`` on success.
* Set an error in *config* and return ``-1`` on error.
If Python is initialized multiple times, ``PyInitConfig_AddModule()`` must
be called at each Python initialization.
Similar to the :c:func:`PyImport_AppendInittab` function.
Initialize Python
-----------------
Expand Down
9 changes: 8 additions & 1 deletion Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ Accessing attributes of extension types
``PyMemberDef`` may contain a definition for the special member
``"__vectorcalloffset__"``, corresponding to
:c:member:`~PyTypeObject.tp_vectorcall_offset` in type objects.
These must be defined with ``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::
This member must be defined with ``Py_T_PYSSIZET``, and either
``Py_READONLY`` or ``Py_READONLY | Py_RELATIVE_OFFSET``. For example::
static PyMemberDef spam_type_members[] = {
{"__vectorcalloffset__", Py_T_PYSSIZET,
Expand All @@ -506,6 +507,12 @@ Accessing attributes of extension types
``PyMemberDef`` is always available.
Previously, it required including ``"structmember.h"``.
.. versionchanged:: 3.14
:c:macro:`Py_RELATIVE_OFFSET` is now allowed for
``"__vectorcalloffset__"``, ``"__dictoffset__"`` and
``"__weaklistoffset__"``.
.. c:function:: PyObject* PyMember_GetOne(const char *obj_addr, struct PyMemberDef *m)
Get an attribute belonging to the object at address *obj_addr*. The
Expand Down
4 changes: 4 additions & 0 deletions Doc/howto/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ Logging Flow
The flow of log event information in loggers and handlers is illustrated in the
following diagram.

.. only:: not html

.. image:: logging_flow.*

.. raw:: html
:file: logging_flow.svg

Expand Down
9 changes: 9 additions & 0 deletions Doc/library/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ A small number of constants live in the built-in namespace. They are:
:exc:`SyntaxError`), so they can be considered "true" constants.


.. _site-consts:

Constants added by the :mod:`site` module
-----------------------------------------

Expand All @@ -97,6 +99,13 @@ should not be used in programs.
(i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the
specified exit code.

.. data:: help
:noindex:

Object that when printed, prints the message "Type help() for interactive
help, or help(object) for help about object.", and when called,
acts as described :func:`elsewhere <help>`.

.. data:: copyright
credits

Expand Down
24 changes: 15 additions & 9 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,23 @@ Class attributes:
Note that, because of normalization, ``timedelta.max`` is greater than ``-timedelta.min``.
``-timedelta.max`` is not representable as a :class:`timedelta` object.


Instance attributes (read-only):

+------------------+--------------------------------------------+
| Attribute | Value |
+==================+============================================+
| ``days`` | Between -999999999 and 999999999 inclusive |
+------------------+--------------------------------------------+
| ``seconds`` | Between 0 and 86399 inclusive |
+------------------+--------------------------------------------+
| ``microseconds`` | Between 0 and 999999 inclusive |
+------------------+--------------------------------------------+
.. attribute:: timedelta.days

Between -999,999,999 and 999,999,999 inclusive.


.. attribute:: timedelta.seconds

Between 0 and 86,399 inclusive.


.. attribute:: timedelta.microseconds

Between 0 and 999,999 inclusive.


Supported operations:

Expand Down
8 changes: 4 additions & 4 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1965,10 +1965,10 @@ are always available. They are listed here in alphabetical order.
``D -> B -> C -> A -> object`` and the value of *type* is ``B``,
then :func:`super` searches ``C -> A -> object``.

The :attr:`~class.__mro__` attribute of the *object_or_type* lists the method
resolution search order used by both :func:`getattr` and :func:`super`. The
attribute is dynamic and can change whenever the inheritance hierarchy is
updated.
The :attr:`~class.__mro__` attribute of the class corresponding to
*object_or_type* lists the method resolution search order used by both
:func:`getattr` and :func:`super`. The attribute is dynamic and can change
whenever the inheritance hierarchy is updated.

If the second argument is omitted, the super object returned is unbound. If
the second argument is an object, ``isinstance(obj, type)`` must be true. If
Expand Down
8 changes: 8 additions & 0 deletions Doc/library/ipaddress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ write code that handles both IP versions correctly. Address objects are

The appropriate version number: ``4`` for IPv4, ``6`` for IPv6.

.. versionchanged:: 3.14

Made available on the class.

.. attribute:: max_prefixlen

The total number of bits in the address representation for this
Expand All @@ -140,6 +144,10 @@ write code that handles both IP versions correctly. Address objects are
are compared to determine whether or not an address is part of a
network.

.. versionchanged:: 3.14

Made available on the class.

.. attribute:: compressed
.. attribute:: exploded

Expand Down
74 changes: 36 additions & 38 deletions Doc/library/json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,39 +241,38 @@ Basic Usage

*object_hook* is an optional function that will be called with the result of
any object literal decoded (a :class:`dict`). The return value of
*object_hook* will be used instead of the :class:`dict`. This feature can be used
to implement custom decoders (e.g. `JSON-RPC <https://www.jsonrpc.org>`_
class hinting).
*object_hook* will be used instead of the :class:`dict`. This feature can
be used to implement custom decoders (e.g. `JSON-RPC
<https://www.jsonrpc.org>`_ class hinting).

*object_pairs_hook* is an optional function that will be called with the
result of any object literal decoded with an ordered list of pairs. The
return value of *object_pairs_hook* will be used instead of the
:class:`dict`. This feature can be used to implement custom decoders.
If *object_hook* is also defined, the *object_pairs_hook* takes priority.
:class:`dict`. This feature can be used to implement custom decoders. If
*object_hook* is also defined, the *object_pairs_hook* takes priority.

.. versionchanged:: 3.1
Added support for *object_pairs_hook*.

*parse_float*, if specified, will be called with the string of every JSON
float to be decoded. By default, this is equivalent to ``float(num_str)``.
This can be used to use another datatype or parser for JSON floats
(e.g. :class:`decimal.Decimal`).
*parse_float* is an optional function that will be called with the string of
every JSON float to be decoded. By default, this is equivalent to
``float(num_str)``. This can be used to use another datatype or parser for
JSON floats (e.g. :class:`decimal.Decimal`).

*parse_int*, if specified, will be called with the string of every JSON int
to be decoded. By default, this is equivalent to ``int(num_str)``. This can
be used to use another datatype or parser for JSON integers
(e.g. :class:`float`).
*parse_int* is an optional function that will be called with the string of
every JSON int to be decoded. By default, this is equivalent to
``int(num_str)``. This can be used to use another datatype or parser for
JSON integers (e.g. :class:`float`).

.. versionchanged:: 3.11
The default *parse_int* of :func:`int` now limits the maximum length of
the integer string via the interpreter's :ref:`integer string
conversion length limitation <int_max_str_digits>` to help avoid denial
of service attacks.

*parse_constant*, if specified, will be called with one of the following
strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``.
This can be used to raise an exception if invalid JSON numbers
are encountered.
*parse_constant* is an optional function that will be called with one of the
following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be
used to raise an exception if invalid JSON numbers are encountered.

.. versionchanged:: 3.1
*parse_constant* doesn't get called on 'null', 'true', 'false' anymore.
Expand Down Expand Up @@ -345,34 +344,33 @@ Encoders and Decoders
It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their
corresponding ``float`` values, which is outside the JSON spec.

*object_hook*, if specified, will be called with the result of every JSON
object decoded and its return value will be used in place of the given
:class:`dict`. This can be used to provide custom deserializations (e.g. to
support `JSON-RPC <https://www.jsonrpc.org>`_ class hinting).
*object_hook* is an optional function that will be called with the result of
every JSON object decoded and its return value will be used in place of the
given :class:`dict`. This can be used to provide custom deserializations
(e.g. to support `JSON-RPC <https://www.jsonrpc.org>`_ class hinting).

*object_pairs_hook*, if specified will be called with the result of every
JSON object decoded with an ordered list of pairs. The return value of
*object_pairs_hook* will be used instead of the :class:`dict`. This
feature can be used to implement custom decoders. If *object_hook* is also
defined, the *object_pairs_hook* takes priority.
*object_pairs_hook* is an optional function that will be called with the
result of every JSON object decoded with an ordered list of pairs. The
return value of *object_pairs_hook* will be used instead of the
:class:`dict`. This feature can be used to implement custom decoders. If
*object_hook* is also defined, the *object_pairs_hook* takes priority.

.. versionchanged:: 3.1
Added support for *object_pairs_hook*.

*parse_float*, if specified, will be called with the string of every JSON
float to be decoded. By default, this is equivalent to ``float(num_str)``.
This can be used to use another datatype or parser for JSON floats
(e.g. :class:`decimal.Decimal`).
*parse_float* is an optional function that will be called with the string of
every JSON float to be decoded. By default, this is equivalent to
``float(num_str)``. This can be used to use another datatype or parser for
JSON floats (e.g. :class:`decimal.Decimal`).

*parse_int*, if specified, will be called with the string of every JSON int
to be decoded. By default, this is equivalent to ``int(num_str)``. This can
be used to use another datatype or parser for JSON integers
(e.g. :class:`float`).
*parse_int* is an optional function that will be called with the string of
every JSON int to be decoded. By default, this is equivalent to
``int(num_str)``. This can be used to use another datatype or parser for
JSON integers (e.g. :class:`float`).

*parse_constant*, if specified, will be called with one of the following
strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``.
This can be used to raise an exception if invalid JSON numbers
are encountered.
*parse_constant* is an optional function that will be called with one of the
following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be
used to raise an exception if invalid JSON numbers are encountered.

If *strict* is false (``True`` is the default), then control characters
will be allowed inside strings. Control characters in this context are
Expand Down
5 changes: 3 additions & 2 deletions Doc/library/site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import can be suppressed using the interpreter's :option:`-S` option.

.. index:: triple: module; search; path

Importing this module will append site-specific paths to the module search path
and add a few builtins, unless :option:`-S` was used. In that case, this module
Importing this module normally appends site-specific paths to the module search path
and adds :ref:`callables <site-consts>`, including :func:`help` to the built-in
namespace. However, Python startup option :option:`-S` blocks this and this module
can be safely imported with no automatic modifications to the module search path
or additions to the builtins. To explicitly trigger the usual site-specific
additions, call the :func:`main` function.
Expand Down
12 changes: 8 additions & 4 deletions Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,14 @@ Constants
``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added.

.. versionchanged:: 3.6.5
On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows
supports.
Added support for ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` on Windows platforms
when available.

.. versionchanged:: 3.7
``TCP_NOTSENT_LOWAT`` was added.

On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows
supports.
Added support for ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` on Windows platforms
when available.

.. versionchanged:: 3.10
``IP_RECVTOS`` was added.
Expand Down Expand Up @@ -454,6 +454,10 @@ Constants
Added missing ``IP_RECVERR``, ``IP_RECVTTL``, and ``IP_RECVORIGDSTADDR``
on Linux.

.. versionchanged:: 3.14
Added support for ``TCP_QUICKACK`` on Windows platforms when available.


.. data:: AF_CAN
PF_CAN
SOL_CAN_*
Expand Down
7 changes: 3 additions & 4 deletions Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ Miscellaneous options
.. versionadded:: 3.13

* :samp:`-X gil={0,1}` forces the GIL to be disabled or enabled,
respectively. Only available in builds configured with
respectively. Setting to ``0`` is only available in builds configured with
:option:`--disable-gil`. See also :envvar:`PYTHON_GIL` and
:ref:`whatsnew313-free-threaded-cpython`.

Expand Down Expand Up @@ -1221,13 +1221,12 @@ conflict.
.. envvar:: PYTHON_GIL

If this variable is set to ``1``, the global interpreter lock (GIL) will be
forced on. Setting it to ``0`` forces the GIL off.
forced on. Setting it to ``0`` forces the GIL off (needs Python configured with
the :option:`--disable-gil` build option).

See also the :option:`-X gil <-X>` command-line option, which takes
precedence over this variable, and :ref:`whatsnew313-free-threaded-cpython`.

Needs Python configured with the :option:`--disable-gil` build option.

.. versionadded:: 3.13

Debug-mode variables
Expand Down
1 change: 1 addition & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ New Features
* :c:func:`PyInitConfig_SetInt`
* :c:func:`PyInitConfig_SetStr`
* :c:func:`PyInitConfig_SetStrList`
* :c:func:`PyInitConfig_AddModule`
* :c:func:`Py_InitializeFromInitConfig`

(Contributed by Victor Stinner in :gh:`107954`.)
Expand Down
Loading

0 comments on commit 75f8ff6

Please sign in to comment.