Skip to content

Commit 57e106d

Browse files
committed
Merge branch 'main' into pythongh-114271-remove-tstate_lock
2 parents d56f892 + cca3023 commit 57e106d

File tree

265 files changed

+6119
-2847
lines changed

Some content is hidden

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

265 files changed

+6119
-2847
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENV WASI_SDK_VERSION=20
66
ENV WASI_SDK_PATH=/opt/wasi-sdk
77

88
ENV WASMTIME_HOME=/opt/wasmtime
9-
ENV WASMTIME_VERSION=14.0.4
9+
ENV WASMTIME_VERSION=18.0.2
1010
ENV WASMTIME_CPU_ARCH=x86_64
1111

1212
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Include/opcode_ids.h generated
8383
Include/token.h generated
8484
Lib/_opcode_metadata.py generated
8585
Lib/keyword.py generated
86+
Lib/test/certdata/*.pem generated
87+
Lib/test/certdata/*.0 generated
8688
Lib/test/levenshtein_examples.json generated
8789
Lib/test/test_stable_abi_ctypes.py generated
8890
Lib/token.py generated

.github/workflows/jit.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
target:
3030
- i686-pc-windows-msvc/msvc
3131
- x86_64-pc-windows-msvc/msvc
32+
- aarch64-pc-windows-msvc/msvc
3233
- x86_64-apple-darwin/clang
3334
- aarch64-apple-darwin/clang
3435
- x86_64-unknown-linux-gnu/gcc
@@ -49,6 +50,10 @@ jobs:
4950
architecture: x64
5051
runner: windows-latest
5152
compiler: msvc
53+
- target: aarch64-pc-windows-msvc/msvc
54+
architecture: ARM64
55+
runner: windows-latest
56+
compiler: msvc
5257
- target: x86_64-apple-darwin/clang
5358
architecture: x86_64
5459
runner: macos-13
@@ -85,14 +90,21 @@ jobs:
8590
with:
8691
python-version: '3.11'
8792

88-
- name: Windows
89-
if: runner.os == 'Windows'
93+
- name: Native Windows
94+
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
9095
run: |
9196
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
9297
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
9398
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
9499
95-
- name: macOS
100+
# No PGO or tests (yet):
101+
- name: Emulated Windows
102+
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
103+
run: |
104+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
105+
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
106+
107+
- name: Native macOS
96108
if: runner.os == 'macOS'
97109
run: |
98110
brew install llvm@${{ matrix.llvm }}

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,17 @@ Lib/test/data/*
6969
/_bootstrap_python
7070
/Makefile
7171
/Makefile.pre
72+
iOSTestbed.*
73+
iOS/Frameworks/
7274
iOS/Resources/Info.plist
75+
iOS/testbed/build
76+
iOS/testbed/Python.xcframework/ios-*/bin
77+
iOS/testbed/Python.xcframework/ios-*/include
78+
iOS/testbed/Python.xcframework/ios-*/lib
79+
iOS/testbed/Python.xcframework/ios-*/Python.framework
80+
iOS/testbed/iOSTestbed.xcodeproj/project.xcworkspace
81+
iOS/testbed/iOSTestbed.xcodeproj/xcuserdata
82+
iOS/testbed/iOSTestbed.xcodeproj/xcshareddata
7383
Mac/Makefile
7484
Mac/PythonLauncher/Info.plist
7585
Mac/PythonLauncher/Makefile

Doc/c-api/contextvars.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Context Variables Objects
66
-------------------------
77

88
.. _contextvarsobjects_pointertype_change:
9+
.. versionadded:: 3.7
10+
911
.. versionchanged:: 3.7.1
1012

1113
.. note::
@@ -24,8 +26,6 @@ Context Variables Objects
2426
See :issue:`34762` for more details.
2527

2628

27-
.. versionadded:: 3.7
28-
2929
This section details the public C API for the :mod:`contextvars` module.
3030

3131
.. c:type:: PyContext

Doc/c-api/import.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Importing Modules
308308
309309
The module name, as an ASCII encoded string.
310310
311-
.. c: member:: PyObject* (*initfunc)(void)
311+
.. c:member:: PyObject* (*initfunc)(void)
312312
313313
Initialization function for a module built into the interpreter.
314314

Doc/c-api/init.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,14 +1575,14 @@ pointer and a void pointer argument.
15751575
function is generally **not** suitable for calling Python code from
15761576
arbitrary C threads. Instead, use the :ref:`PyGILState API<gilstate>`.
15771577
1578+
.. versionadded:: 3.1
1579+
15781580
.. versionchanged:: 3.9
15791581
If this function is called in a subinterpreter, the function *func* is
15801582
now scheduled to be called from the subinterpreter, rather than being
15811583
called from the main interpreter. Each subinterpreter now has its own
15821584
list of scheduled calls.
15831585
1584-
.. versionadded:: 3.1
1585-
15861586
.. _profiling:
15871587
15881588
Profiling and Tracing

Doc/c-api/refcounting.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ of Python objects.
2323
2424
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
2525
26-
.. versionchanged:: 3.11
27-
The parameter type is no longer :c:expr:`const PyObject*`.
28-
2926
.. versionchanged:: 3.10
3027
:c:func:`Py_REFCNT()` is changed to the inline static function.
3128
29+
.. versionchanged:: 3.11
30+
The parameter type is no longer :c:expr:`const PyObject*`.
31+
3232
3333
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
3434

Doc/c-api/structures.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,20 +702,20 @@ Defining Getters and Setters
702702
703703
.. c:member:: void* closure
704704
705-
Optional function pointer, providing additional data for getter and setter.
705+
Optional user data pointer, providing additional data for getter and setter.
706706
707707
.. c:type:: PyObject *(*getter)(PyObject *, void *)
708708
709709
The ``get`` function takes one :c:expr:`PyObject*` parameter (the
710-
instance) and a function pointer (the associated ``closure``):
710+
instance) and a user data pointer (the associated ``closure``):
711711
712712
It should return a new reference on success or ``NULL`` with a set exception
713713
on failure.
714714
715715
.. c:type:: int (*setter)(PyObject *, PyObject *, void *)
716716
717717
``set`` functions take two :c:expr:`PyObject*` parameters (the instance and
718-
the value to be set) and a function pointer (the associated ``closure``):
718+
the value to be set) and a user data pointer (the associated ``closure``):
719719
720720
In case the attribute should be deleted the second parameter is ``NULL``.
721721
Should return ``0`` on success or ``-1`` with a set exception on failure.

Doc/faq/general.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ Python versions are numbered "A.B.C" or "A.B":
133133
changes.
134134
* *C* is the micro version number -- it is incremented for each bugfix release.
135135

136-
See :pep:`6` for more information about bugfix releases.
137-
138136
Not all releases are bugfix releases. In the run-up to a new feature release, a
139137
series of development releases are made, denoted as alpha, beta, or release
140138
candidate. Alphas are early releases in which interfaces aren't yet finalized;
@@ -157,7 +155,11 @@ unreleased versions, built directly from the CPython development repository. In
157155
practice, after a final minor release is made, the version is incremented to the
158156
next minor version, which becomes the "a0" version, e.g. "2.4a0".
159157

160-
See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, and
158+
See the `Developer's Guide
159+
<https://devguide.python.org/developer-workflow/development-cycle/>`__
160+
for more information about the development cycle, and
161+
:pep:`387` to learn more about Python's backward compatibility policy. See also
162+
the documentation for :data:`sys.version`, :data:`sys.hexversion`, and
161163
:data:`sys.version_info`.
162164

163165

Doc/library/asyncio-eventloop.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@ Opening network connections
605605
The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*,
606606
*allow_broadcast*, and *sock* parameters were added.
607607

608+
.. versionchanged:: 3.8
609+
Added support for Windows.
610+
608611
.. versionchanged:: 3.8.1
609612
The *reuse_address* parameter is no longer supported, as using
610613
:ref:`socket.SO_REUSEADDR <socket-unix-constants>`
@@ -622,11 +625,8 @@ Opening network connections
622625
prevents processes with differing UIDs from assigning sockets to the same
623626
socket address.
624627

625-
.. versionchanged:: 3.8
626-
Added support for Windows.
627-
628628
.. versionchanged:: 3.11
629-
The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1,
629+
The *reuse_address* parameter, disabled since Python 3.8.1,
630630
3.7.6 and 3.6.10, has been entirely removed.
631631

632632
.. coroutinemethod:: loop.create_unix_connection(protocol_factory, \

Doc/library/asyncio-stream.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ StreamWriter
347347
be resumed. When there is nothing to wait for, the :meth:`drain`
348348
returns immediately.
349349

350-
.. coroutinemethod:: start_tls(sslcontext, \*, server_hostname=None, \
350+
.. coroutinemethod:: start_tls(sslcontext, *, server_hostname=None, \
351351
ssl_handshake_timeout=None, ssl_shutdown_timeout=None)
352352

353353
Upgrade an existing stream-based connection to TLS.

Doc/library/asyncio-task.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,13 @@ and reliable way to wait for all tasks in the group to finish.
334334

335335
Create a task in this task group.
336336
The signature matches that of :func:`asyncio.create_task`.
337+
If the task group is inactive (e.g. not yet entered,
338+
already finished, or in the process of shutting down),
339+
we will close the given ``coro``.
340+
341+
.. versionchanged:: 3.13
342+
343+
Close the given coroutine if the task group is not active.
337344

338345
Example::
339346

Doc/library/audit_events.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Audit events table
77

88
This table contains all events raised by :func:`sys.audit` or
99
:c:func:`PySys_Audit` calls throughout the CPython runtime and the
10-
standard library. These calls were added in 3.8.0 or later (see :pep:`578`).
10+
standard library. These calls were added in 3.8 or later (see :pep:`578`).
1111

1212
See :func:`sys.addaudithook` and :c:func:`PySys_AddAuditHook` for
1313
information on handling these events.

Doc/library/bz2.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ The :mod:`bz2` module contains:
156156
Support was added for *filename* being a :term:`file object` instead of an
157157
actual filename.
158158

159-
.. versionchanged:: 3.3
160159
The ``'a'`` (append) mode was added, along with support for reading
161160
multi-stream files.
162161

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``.
343343
All of those tests treat missing elements as having zero counts so that
344344
``Counter(a=1) == Counter(a=1, b=0)`` returns true.
345345

346-
.. versionadded:: 3.10
346+
.. versionchanged:: 3.10
347347
Rich comparison operations were added.
348348

349349
.. versionchanged:: 3.10

Doc/library/configparser.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,10 @@ ConfigParser Objects
978978
The default *dict_type* is :class:`dict`, since it now preserves
979979
insertion order.
980980

981+
.. versionchanged:: 3.13
982+
Raise a :exc:`MultilineContinuationError` when *allow_no_value* is
983+
``True``, and a key without a value is continued with an indented line.
984+
981985
.. method:: defaults()
982986

983987
Return a dictionary containing the instance-wide defaults.
@@ -1349,6 +1353,13 @@ Exceptions
13491353
The ``filename`` attribute and :meth:`!__init__` constructor argument were
13501354
removed. They have been available using the name ``source`` since 3.2.
13511355

1356+
.. exception:: MultilineContinuationError
1357+
1358+
Exception raised when a key without a corresponding value is continued with
1359+
an indented line.
1360+
1361+
.. versionadded:: 3.13
1362+
13521363
.. rubric:: Footnotes
13531364

13541365
.. [1] Config parsers allow for heavy customization. If you are interested in

Doc/library/decimal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ are also included in the pure Python version for compatibility.
15171517
the C version uses a thread-local rather than a coroutine-local context and the value
15181518
is ``False``. This is slightly faster in some nested context scenarios.
15191519

1520-
.. versionadded:: 3.9 backported to 3.7 and 3.8.
1520+
.. versionadded:: 3.8.3
15211521

15221522

15231523
Rounding modes

Doc/library/enum.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Data Types
170170
final *enum*, as well as creating the enum members, properly handling
171171
duplicates, providing iteration over the enum class, etc.
172172

173-
.. method:: EnumType.__call__(cls, value, names=None, \*, module=None, qualname=None, type=None, start=1, boundary=None)
173+
.. method:: EnumType.__call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
174174

175175
This method is called in two different ways:
176176

@@ -350,7 +350,7 @@ Data Types
350350
>>> PowersOfThree.SECOND.value
351351
9
352352

353-
.. method:: Enum.__init__(self, \*args, \**kwds)
353+
.. method:: Enum.__init__(self, *args, **kwds)
354354

355355
By default, does nothing. If multiple values are given in the member
356356
assignment, those values become separate arguments to ``__init__``; e.g.
@@ -361,7 +361,7 @@ Data Types
361361

362362
``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, 'Mon')``
363363

364-
.. method:: Enum.__init_subclass__(cls, \**kwds)
364+
.. method:: Enum.__init_subclass__(cls, **kwds)
365365

366366
A *classmethod* that is used to further configure subsequent subclasses.
367367
By default, does nothing.
@@ -388,7 +388,7 @@ Data Types
388388
>>> Build('deBUG')
389389
<Build.DEBUG: 'debug'>
390390

391-
.. method:: Enum.__new__(cls, \*args, \**kwds)
391+
.. method:: Enum.__new__(cls, *args, **kwds)
392392

393393
By default, doesn't exist. If specified, either in the enum class
394394
definition or in a mixin class (such as ``int``), all values given

Doc/library/faulthandler.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ Dumping the tracebacks after a timeout
118118

119119
This function is implemented using a watchdog thread.
120120

121-
.. versionchanged:: 3.7
122-
This function is now always available.
123-
124121
.. versionchanged:: 3.5
125122
Added support for passing file descriptor to this function.
126123

124+
.. versionchanged:: 3.7
125+
This function is now always available.
126+
127127
.. function:: cancel_dump_traceback_later()
128128

129129
Cancel the last call to :func:`dump_traceback_later`.

Doc/library/filecmp.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,20 @@ The :mod:`filecmp` module defines the following functions:
7070
The :class:`dircmp` class
7171
-------------------------
7272

73-
.. class:: dircmp(a, b, ignore=None, hide=None)
73+
.. class:: dircmp(a, b, ignore=None, hide=None, shallow=True)
7474

7575
Construct a new directory comparison object, to compare the directories *a*
7676
and *b*. *ignore* is a list of names to ignore, and defaults to
7777
:const:`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and
7878
defaults to ``[os.curdir, os.pardir]``.
7979

8080
The :class:`dircmp` class compares files by doing *shallow* comparisons
81-
as described for :func:`filecmp.cmp`.
81+
as described for :func:`filecmp.cmp` by default using the *shallow*
82+
parameter.
83+
84+
.. versionchanged:: 3.13
85+
86+
Added the *shallow* parameter.
8287

8388
The :class:`dircmp` class provides the following methods:
8489

Doc/library/functools.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,13 +667,9 @@ The :mod:`functools` module defines the following functions:
667667
on the wrapper function). :exc:`AttributeError` is still raised if the
668668
wrapper function itself is missing any attributes named in *updated*.
669669

670-
.. versionadded:: 3.2
671-
Automatic addition of the ``__wrapped__`` attribute.
672-
673-
.. versionadded:: 3.2
674-
Copying of the ``__annotations__`` attribute by default.
675-
676670
.. versionchanged:: 3.2
671+
The ``__wrapped__`` attribute is now automatically added.
672+
The ``__annotations__`` attribute is now copied by default.
677673
Missing attributes no longer trigger an :exc:`AttributeError`.
678674

679675
.. versionchanged:: 3.4

0 commit comments

Comments
 (0)