Skip to content

Commit

Permalink
Merge branch 'main' into feat/codecs/surrogate-escape-handler-129173
Browse files Browse the repository at this point in the history
  • Loading branch information
picnixz authored Feb 14, 2025
2 parents 82ef07a + 1775091 commit 6494cab
Show file tree
Hide file tree
Showing 287 changed files with 7,045 additions and 3,230 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
Windows
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: build-context
if: fromJSON(needs.build-context.outputs.run-tests)
if: fromJSON(needs.build-context.outputs.run-windows-tests)
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -621,6 +621,7 @@ jobs:
- build_wasi
- build_windows
- build_windows_msi
- cross-build-linux
- test_hypothesis
- build_asan
- build_tsan
Expand Down Expand Up @@ -654,10 +655,17 @@ jobs:
build_ubuntu,
build_ubuntu_ssltests,
build_wasi,
build_windows,
build_asan,
build_tsan,
test_hypothesis,
cross-build-linux,
'
|| ''
}}
${{
!fromJSON(needs.build-context.outputs.run-windows-tests)
&& '
build_windows,
'
|| ''
}}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/reusable-context.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on: # yamllint disable-line rule:truthy
run-tests:
description: Whether to run the regular tests
value: ${{ jobs.compute-changes.outputs.run-tests }} # bool
run-windows-tests:
description: Whether to run the Windows tests
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
run-windows-msi:
description: Whether to run the MSI installer smoke tests
value: ${{ jobs.compute-changes.outputs.run-windows-msi }} # bool
Expand All @@ -44,6 +47,7 @@ jobs:
run-docs: ${{ steps.changes.outputs.run-docs }}
run-tests: ${{ steps.changes.outputs.run-tests }}
run-windows-msi: ${{ steps.changes.outputs.run-windows-msi }}
run-windows-tests: ${{ steps.changes.outputs.run-windows-tests }}
steps:
- name: Set up Python
uses: actions/setup-python@v5
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/tail-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- aarch64-apple-darwin/clang
- x86_64-unknown-linux-gnu/gcc
- aarch64-unknown-linux-gnu/gcc
- free-threading
llvm:
- 19
include:
Expand All @@ -65,6 +66,9 @@ jobs:
- target: aarch64-unknown-linux-gnu/gcc
architecture: aarch64
runner: ubuntu-22.04-arm
- target: free-threading
architecture: x86_64
runner: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -105,11 +109,20 @@ jobs:
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
- name: Native Linux (release)
if: runner.os == 'Linux'
if: runner.os == 'Linux' && matrix.target != 'free-threading'
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
CC=clang-19 ./configure --with-tail-call-interp
make all --jobs 4
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
- name: Native Linux with free-threading (release)
if: matrix.target == 'free-threading'
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
CC=clang-19 ./configure --with-tail-call-interp --disable-gil
make all --jobs 4
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
2 changes: 1 addition & 1 deletion Doc/c-api/bytearray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Direct API functions
Resize the internal buffer of *bytearray* to *len*.
Failure is a ``-1`` return with an exception set.
.. versionchanged:: next
.. versionchanged:: 3.14
A negative *len* will now result in an exception being set and -1 returned.
Expand Down
8 changes: 4 additions & 4 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ Process-wide parameters
interpreter will change the contents of this storage.
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
:c:expr:`wchar_*` string.
:c:expr:`wchar_t*` string.
.. deprecated-removed:: 3.11 3.15
Expand Down Expand Up @@ -852,7 +852,7 @@ Process-wide parameters
directory (``"."``).
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
:c:expr:`wchar_*` string.
:c:expr:`wchar_t*` string.
See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
members of the :ref:`Python Initialization Configuration <init-config>`.
Expand Down Expand Up @@ -888,7 +888,7 @@ Process-wide parameters
:option:`-I`.
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
:c:expr:`wchar_*` string.
:c:expr:`wchar_t*` string.
See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
members of the :ref:`Python Initialization Configuration <init-config>`.
Expand All @@ -914,7 +914,7 @@ Process-wide parameters
this storage.
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
:c:expr:`wchar_*` string.
:c:expr:`wchar_t*` string.
.. deprecated-removed:: 3.11 3.15
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ Object Protocol
Objects that are immortal in one CPython version are not guaranteed to
be immortal in another.
.. versionadded:: next
.. versionadded:: 3.14
.. c:function:: int PyUnstable_TryIncRef(PyObject *obj)
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
dictionary, so it is may be more efficient to call :c:func:`PyObject_GetAttr`
when accessing an attribute on the object.

It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit and
It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and
:c:member:`~PyTypeObject.tp_dictoffset`.

**Inheritance:**
Expand Down
16 changes: 9 additions & 7 deletions Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,8 @@ the Python configuration.
.. c:function:: int Py_UNICODE_ISPRINTABLE(Py_UCS4 ch)
Return ``1`` or ``0`` depending on whether *ch* is a printable character.
Nonprintable characters are those characters defined in the Unicode character
database as "Other" or "Separator", excepting the ASCII space (0x20) which is
considered printable. (Note that printable characters in this context are
those which should not be escaped when :func:`repr` is invoked on a string.
It has no bearing on the handling of strings written to :data:`sys.stdout` or
:data:`sys.stderr`.)
Return ``1`` or ``0`` depending on whether *ch* is a printable character,
in the sense of :meth:`str.isprintable`.
These APIs can be used for fast direct character conversions:
Expand Down Expand Up @@ -1352,6 +1347,13 @@ the user settings on the machine running the codec.
in *consumed*.
.. c:function:: PyObject* PyUnicode_DecodeCodePageStateful(int code_page, const char *str, \
Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page
specified by *code_page*.
.. c:function:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode)
Encode a Unicode object using MBCS and return the result as Python bytes
Expand Down
7 changes: 7 additions & 0 deletions Doc/data/refcounts.dat
Original file line number Diff line number Diff line change
Expand Up @@ -2636,6 +2636,13 @@ PyUnicode_DecodeMBCSStateful:Py_ssize_t:size::
PyUnicode_DecodeMBCSStateful:const char*:errors::
PyUnicode_DecodeMBCSStateful:Py_ssize_t*:consumed::

PyUnicode_DecodeCodePageStateful:PyObject*::+1:
PyUnicode_DecodeCodePageStateful:int:code_page::
PyUnicode_DecodeCodePageStateful:const char*:s::
PyUnicode_DecodeCodePageStateful:Py_ssize_t:size::
PyUnicode_DecodeCodePageStateful:const char*:errors::
PyUnicode_DecodeCodePageStateful:Py_ssize_t*:consumed::

PyUnicode_EncodeCodePage:PyObject*::+1:
PyUnicode_EncodeCodePage:int:code_page::
PyUnicode_EncodeCodePage:PyObject*:unicode:0:
Expand Down
10 changes: 10 additions & 0 deletions Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Pending removal in Python 3.15
* The :option:`!--cgi` flag to the :program:`python -m http.server`
command-line interface has been deprecated since Python 3.13.

* :mod:`importlib`:

* ``load_module()`` method: use ``exec_module()`` instead.

* :class:`locale`:

* The :func:`~locale.getdefaultlocale` function
Expand Down Expand Up @@ -92,3 +96,9 @@ Pending removal in Python 3.15
and :meth:`~wave.Wave_read.getmarkers` methods of
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes
have been deprecated since Python 3.13.

* :mod:`zipimport`:

* :meth:`~zipimport.zipimporter.load_module` has been deprecated since
Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead.
(Contributed by Jiahao Li in :gh:`125746`.)
4 changes: 0 additions & 4 deletions Doc/deprecations/pending-removal-in-future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ although there is currently no date scheduled for their removal.

* :mod:`importlib`:

* ``load_module()`` method: use ``exec_module()`` instead.
* :func:`~importlib.util.cache_from_source` *debug_override* parameter is
deprecated: use the *optimization* parameter instead.

Expand Down Expand Up @@ -152,6 +151,3 @@ although there is currently no date scheduled for their removal.
:class:`~xml.etree.ElementTree.Element` is deprecated. In a future release it
will always return ``True``. Prefer explicit ``len(elem)`` or
``elem is not None`` tests instead.

* :meth:`zipimport.zipimporter.load_module` is deprecated:
use :meth:`~zipimport.zipimporter.exec_module` instead.
2 changes: 1 addition & 1 deletion Doc/library/asyncio-graph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ a suspended *future*. These utilities and the underlying machinery
can be used from within a Python program or by external profilers
and debuggers.

.. versionadded:: next
.. versionadded:: 3.14


.. function:: print_call_graph(future=None, /, *, file=None, depth=1, limit=None)
Expand Down
15 changes: 15 additions & 0 deletions Doc/library/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ Context Variables
the value of the variable to what it was before the corresponding
*set*.

The token supports :ref:`context manager protocol <context-managers>`
to restore the corresponding context variable value at the exit from
:keyword:`with` block::

var = ContextVar('var', default='default value')

with var.set('new value'):
assert var.get() == 'new value'

assert var.get() == 'default value'

.. versionadded:: next

Added support for usage as a context manager.

.. attribute:: Token.var

A read-only property. Points to the :class:`ContextVar` object
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,7 @@ Utility functions
executable file. It may be an empty string.

.. availability:: Windows, macOS, iOS, glibc, BSD libc, musl
.. versionadded:: next
.. versionadded:: 3.14

.. function:: FormatError([code])

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/dbm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ The :mod:`!dbm.dumb` module defines the following:
.. method:: dumbdbm.sync()

Synchronize the on-disk directory and data files. This method is called
by the :meth:`Shelve.sync` method.
by the :meth:`shelve.Shelf.sync` method.

.. method:: dumbdbm.close()

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/imaplib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ An :class:`IMAP4` instance has the following methods:
iteration, and public method to remain stable, but should not subclass,
instantiate, compare, or otherwise directly reference the class.

.. versionadded:: next
.. versionadded:: 3.14


.. method:: IMAP4.list([directory[, pattern]])
Expand Down
12 changes: 6 additions & 6 deletions Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ ABC hierarchy::
:exc:`NotImplementedError`. Functionality provided when
:meth:`exec_module` is available.

.. deprecated:: 3.4
.. deprecated-removed:: 3.4 3.15
The recommended API for loading a module is :meth:`exec_module`
(and :meth:`create_module`). Loaders should implement it instead of
:meth:`load_module`. The import machinery takes care of all the
Expand Down Expand Up @@ -474,7 +474,7 @@ ABC hierarchy::

Implementation of :meth:`Loader.load_module`.

.. deprecated:: 3.4
.. deprecated-removed:: 3.4 3.15
use :meth:`exec_module` instead.


Expand Down Expand Up @@ -521,7 +521,7 @@ ABC hierarchy::

Calls super's ``load_module()``.

.. deprecated:: 3.4
.. deprecated-removed:: 3.4 3.15
Use :meth:`Loader.exec_module` instead.

.. abstractmethod:: get_filename(fullname)
Expand Down Expand Up @@ -610,7 +610,7 @@ ABC hierarchy::

Concrete implementation of :meth:`Loader.load_module`.

.. deprecated:: 3.4
.. deprecated-removed:: 3.4 3.15
Use :meth:`exec_module` instead.

.. method:: get_source(fullname)
Expand Down Expand Up @@ -1020,7 +1020,7 @@ find and load modules.
Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
specifying the name of the module to load is optional.

.. deprecated:: 3.6
.. deprecated-removed:: 3.6 3.15

Use :meth:`importlib.abc.Loader.exec_module` instead.

Expand Down Expand Up @@ -1063,7 +1063,7 @@ find and load modules.
Concrete implementation of :meth:`importlib.abc.Loader.load_module` where
specifying the name of the module to load is optional.

.. deprecated:: 3.6
.. deprecated-removed:: 3.6 3.15

Use :meth:`importlib.abc.Loader.exec_module` instead.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):

Add ``__builtins__`` attribute to functions.

.. versionchanged:: next
.. versionchanged:: 3.14

Add ``f_generator`` attribute to frames.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
:meth:`io.BufferedIOBase.readinto`, :meth:`io.BufferedIOBase.read`, or
:meth:`io.TextIOBase.read`

.. versionadded:: next
.. versionadded:: 3.14


.. function:: sendfile(out_fd, in_fd, offset, count)
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/plistlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ This module defines the following functions:

.. function:: dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False, aware_datetime=False)

Write *value* to a plist file. *Fp* should be a writable, binary
Write *value* to a plist file. *fp* should be a writable, binary
file object.

The *fmt* argument specifies the format of the plist file and can be
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/shutil.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ file then shutil will silently fallback on using less efficient
.. versionchanged:: 3.14
Solaris now uses :func:`os.sendfile`.

.. versionchanged:: next
.. versionchanged:: 3.14
Copy-on-write or server-side copy may be used internally via
:func:`os.copy_file_range` on supported Linux filesystems.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/smtplib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ An :class:`SMTP` instance has the following methods:
:mailheader:`Bcc` or :mailheader:`Resent-Bcc` headers that may appear
in *msg*. If any of the addresses in *from_addr* and *to_addrs* contain
non-ASCII characters and the server does not advertise ``SMTPUTF8`` support,
an :exc:`SMTPNotSupported` error is raised. Otherwise the ``Message`` is
an :exc:`SMTPNotSupportedError` is raised. Otherwise the ``Message`` is
serialized with a clone of its :mod:`~email.policy` with the
:attr:`~email.policy.EmailPolicy.utf8` attribute set to ``True``, and
``SMTPUTF8`` and ``BODY=8BITMIME`` are added to *mail_options*.
Expand Down
Loading

0 comments on commit 6494cab

Please sign in to comment.