Skip to content

Commit 8c8d310

Browse files
itamarometa-codesync[bot]
authored andcommitted
Sync pre-release CPython main branch from GitHub (2026-07-13)
Summary: Imported python/cpython `3.16.0a0` from upstream rev [`1fece44`](https://www.github.com/python/cpython/commit/1fece4457032382947c7c2a5c9e95dc106ca7a7d) (committed 2026-07-13 09:46:24+00:00). # Commit Info - Base: (`3.16.0a0`) - [`6c389c4`](https://www.github.com/python/cpython/commit/6c389c446e487bcb9d09e85de30aa42052990f1c) (commit date: 2026-07-10 02:38:58+00:00) - Imported: (`3.16.0a0`) - [`1fece44`](https://www.github.com/python/cpython/commit/1fece4457032382947c7c2a5c9e95dc106ca7a7d) (commit date: 2026-07-13 09:46:24+00:00) # Noteworthy file changes - Native files (6 added): ``` + Modules/expat/fallthrough.h + Modules/expat/memory_sanitizer.h + Modules/expat/xcsinc.c + Parser/lexer/lexer_internal.h + Parser/lexer/number.c + Parser/lexer/string.c ``` - Stdlib files (2 added) - Test files (2 added) - Low-signal files (24 added) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GD0hQSUpb2ftKv5eAF9SsewHillsbr0LAAAz Reviewed By: QuantumManiac Differential Revision: D111728640 fbshipit-source-id: 0ad2d621568c0b4ec824666ea84aba0040d11d5d
1 parent 12baa85 commit 8c8d310

119 files changed

Lines changed: 4454 additions & 2178 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ jobs:
554554
- Thread
555555
free-threading:
556556
- false
557+
- true
557558
sanitizer:
558559
- TSan
559560
include:
@@ -565,17 +566,6 @@ jobs:
565566
sanitizer: ${{ matrix.sanitizer }}
566567
free-threading: ${{ matrix.free-threading }}
567568

568-
# XXX: Temporarily allow this job to fail to not block PRs.
569-
build-san-free-threading:
570-
# ${{ '' } is a hack to nest jobs under the same sidebar category.
571-
name: Sanitizers${{ '' }} # zizmor: ignore[obfuscation]
572-
needs: build-context
573-
if: needs.build-context.outputs.run-ubuntu == 'true'
574-
uses: ./.github/workflows/reusable-san.yml
575-
with:
576-
sanitizer: TSan
577-
free-threading: true
578-
579569
cross-build-linux:
580570
name: Cross build Linux
581571
runs-on: ubuntu-26.04
@@ -679,7 +669,6 @@ jobs:
679669
- test-hypothesis
680670
- build-asan
681671
- build-san
682-
- build-san-free-threading
683672
- cross-build-linux
684673
- cifuzz
685674
if: always()
@@ -691,7 +680,6 @@ jobs:
691680
allowed-failures: >-
692681
build-android,
693682
build-emscripten,
694-
build-san-free-threading,
695683
build-windows-msi,
696684
build-ubuntu-ssltests,
697685
test-hypothesis,

Doc/c-api/float.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ most likely :exc:`OverflowError`).
233233
234234
Pack a C double as the IEEE 754 binary64 double precision format.
235235
236-
.. impl-detail::
237-
This function always succeeds in CPython.
238-
239236
240237
Unpack functions
241238
^^^^^^^^^^^^^^^^
@@ -251,9 +248,6 @@ Return value: The unpacked double. On error, this is ``-1.0`` and
251248
:c:func:`PyErr_Occurred` is true (and an exception is set, most likely
252249
:exc:`OverflowError`).
253250
254-
.. impl-detail::
255-
These functions always succeed in CPython.
256-
257251
.. c:function:: double PyFloat_Unpack2(const char *p, int le)
258252
259253
Unpack the IEEE 754 binary16 half-precision format as a C double.

Doc/deprecations/pending-removal-in-3.19.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ Pending removal in Python 3.19
4040
Before Python 3.14, this property was used to implement the corresponding
4141
``read()`` and ``readline()`` methods for :class:`~imaplib.IMAP4` but this
4242
is no longer the case since then.
43+
44+
* :mod:`tkinter`:
45+
46+
* :func:`tkinter.filedialog.askopenfiles` has been deprecated since Python
47+
3.16. Iterate over the names returned by
48+
:func:`~tkinter.filedialog.askopenfilenames` and open them one by one
49+
instead.
50+
(Contributed by Serhiy Storchaka in :gh:`152638`.)

Doc/library/asyncio-eventloop.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,12 +1145,21 @@ convenient.
11451145

11461146
*sock* must be a non-blocking socket.
11471147

1148+
With :class:`SelectorEventLoop`, *address* does not need to be resolved:
1149+
for :const:`~socket.AF_INET` and :const:`~socket.AF_INET6` sockets,
1150+
``sock_connect`` first checks whether *address* is already resolved by
1151+
calling :func:`socket.inet_pton`, and uses :meth:`loop.getaddrinfo` to
1152+
resolve it if it is not.
1153+
1154+
:class:`ProactorEventLoop`, the default event loop on Windows, does not
1155+
resolve *address*. The host must already be a numeric IP address; passing
1156+
a host name raises :exc:`OSError`. Resolve the address with
1157+
:meth:`loop.getaddrinfo` first, or use :meth:`loop.create_connection`,
1158+
which resolves the address on every platform.
1159+
11481160
.. versionchanged:: 3.5.2
1149-
``address`` no longer needs to be resolved. ``sock_connect``
1150-
will try to check if the *address* is already resolved by calling
1151-
:func:`socket.inet_pton`. If not,
1152-
:meth:`loop.getaddrinfo` will be used to resolve the
1153-
*address*.
1161+
With :class:`SelectorEventLoop`, ``address`` no longer needs to be
1162+
resolved.
11541163

11551164
.. seealso::
11561165

Doc/library/asyncio-queue.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ Queue
7171
Return an item if one is immediately available, else raise
7272
:exc:`QueueEmpty`.
7373

74+
Raises :exc:`QueueShutDown` if the queue has been shut down and is empty.
75+
7476
.. method:: join()
7577
:async:
7678

@@ -96,6 +98,8 @@ Queue
9698

9799
If no free slot is immediately available, raise :exc:`QueueFull`.
98100

101+
Raises :exc:`QueueShutDown` if the queue has been shut down.
102+
99103
.. method:: qsize()
100104

101105
Return the number of items in the queue.
@@ -188,8 +192,9 @@ Exceptions
188192

189193
.. exception:: QueueShutDown
190194

191-
Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is
192-
called on a queue which has been shut down.
195+
Exception raised when :meth:`~Queue.put`, :meth:`~Queue.put_nowait`,
196+
:meth:`~Queue.get` or :meth:`~Queue.get_nowait` is called
197+
on a queue which has been shut down.
193198

194199
.. versionadded:: 3.13
195200

Doc/library/asyncio-task.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,9 @@ Waiting primitives
924924
Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the
925925
futures when a timeout occurs.
926926

927+
If ``wait()`` is cancelled, the futures in *aws* are not cancelled
928+
and continue to run.
929+
927930
.. versionchanged:: 3.10
928931
Removed the *loop* parameter.
929932

@@ -981,6 +984,10 @@ Waiting primitives
981984
are done. This is raised by the ``async for`` loop during asynchronous
982985
iteration or by the coroutines yielded during plain iteration.
983986

987+
``as_completed()`` does not cancel the tasks running the supplied
988+
awaitables: if a timeout occurs or the iteration is cancelled, the
989+
remaining tasks continue to run.
990+
984991
.. versionchanged:: 3.10
985992
Removed the *loop* parameter.
986993

Doc/library/asyncio-tools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The following commands inspect the process identified by ``PID``:
2424
2525
The commands read the target process state without executing any code in it.
2626
They are only available on supported platforms and may require permission to
27-
inspect another process. See the :ref:`permission-requirements <permission-requirements>` for details.
27+
inspect another process. See the :ref:`permission requirements <permission-requirements>` for details.
2828

2929
.. seealso::
3030

Doc/library/dialog.rst

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,23 @@ cancelled it is the empty value documented for that function -- an empty
163163
string, an empty tuple, an empty list or ``None``.
164164

165165
.. function:: askopenfile(mode="r", **options)
166-
askopenfiles(mode="r", **options)
167166

168-
Create an :class:`Open` dialog.
169-
:func:`askopenfile` returns the opened file object, or ``None`` if the
170-
dialog is cancelled.
171-
:func:`askopenfiles` returns a list of the opened file objects, or an empty
172-
list if cancelled.
167+
Create an :class:`Open` dialog and return the opened file object,
168+
or ``None`` if the dialog is cancelled.
169+
The file is opened in mode *mode* (read-only ``'r'`` by default).
170+
171+
.. function:: askopenfiles(mode="r", **options)
172+
173+
Create an :class:`Open` dialog and return a list of the opened file objects,
174+
or an empty list if cancelled.
173175
The files are opened in mode *mode* (read-only ``'r'`` by default).
174176

177+
.. deprecated-removed:: next 3.19
178+
Opening several files at once is error-prone,
179+
and the returned list cannot be used in a :keyword:`with` statement.
180+
Iterate over the names returned by :func:`askopenfilenames`
181+
and open them one by one instead.
182+
175183
.. function:: asksaveasfile(mode="w", **options)
176184

177185
Create a :class:`SaveAs` dialog and return the opened file object, or
@@ -201,19 +209,16 @@ string, an empty tuple, an empty list or ``None``.
201209

202210
.. class:: Open(master=None, **options)
203211
SaveAs(master=None, **options)
212+
Directory(master=None, **options)
204213
205-
The above two classes provide native dialog windows for saving and loading
206-
files.
214+
The above three classes provide native dialog windows for loading and saving
215+
files and for selecting a directory.
207216

208217
**Convenience classes**
209218

210219
The below classes are used for creating file/directory windows from scratch.
211220
These do not emulate the native look-and-feel of the platform.
212221

213-
.. class:: Directory(master=None, **options)
214-
215-
Create a dialog prompting the user to select a directory.
216-
217222
.. note:: The *FileDialog* class should be subclassed for custom event
218223
handling and behaviour.
219224

@@ -353,23 +358,25 @@ the classic (non-themed) Tk widgets.
353358

354359
.. data:: DIALOG_ICON
355360

356-
The name of the default bitmap (``'questhead'``) displayed by a
357-
:class:`Dialog`.
361+
The name of a bitmap (``'questhead'``) suitable for use as the *bitmap*
362+
of a :class:`Dialog`.
358363

359364
.. class:: Dialog(master=None, cnf={}, **kw)
360365

361366
Display a modal dialog box built from the classic (non-themed) Tk widgets
362367
and wait for the user to press one of its buttons.
363-
The options, given through *cnf* or as keyword arguments, include *title*
364-
(the window title), *text* (the message), *bitmap* (an icon,
365-
:data:`DIALOG_ICON` by default), *default* (the index of the default button)
366-
and *strings* (the sequence of button labels).
368+
The options, given through *cnf* or as keyword arguments, are all required:
369+
*title* (the window title), *text* (the message), *bitmap* (the name of a
370+
bitmap icon, such as :data:`DIALOG_ICON`), *default* (the index of the
371+
default button) and *strings* (the sequence of button labels).
367372
After construction, the :attr:`!num` attribute holds the index of the button
368373
the user pressed.
369374

370375
.. method:: destroy()
371376

372-
Destroy the dialog window.
377+
Do nothing.
378+
The dialog window is destroyed automatically before the constructor
379+
returns, so there is nothing left for this method to do.
373380

374381

375382
.. seealso::

0 commit comments

Comments
 (0)