Skip to content

Commit 3fb9d1e

Browse files
authored
Merge branch 'main' into asyncio.barrier-reuse-index-when-task-cancel
2 parents 76c777b + 8c3b566 commit 3fb9d1e

51 files changed

Lines changed: 1124 additions & 218 deletions

Some content is hidden

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

‎Doc/pylock.toml‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e
167167

168168
[[packages]]
169169
name = "docutils"
170-
version = "0.21.2"
171-
sdist = { url = "https://files.pythonhosted.org/packages/ae/ed/aefcc8cd0ba62a0560c3c18c33925362d46c6075480bfa4df87b28e169a9/docutils-0.21.2.tar.gz", upload-time = 2024-04-23T18:57:18Z, size = 2204444, hashes = { sha256 = "3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f" } }
172-
wheels = [{ url = "https://files.pythonhosted.org/packages/8f/d7/9322c609343d929e75e7e5e6255e614fcc67572cfd083959cdef3b7aad79/docutils-0.21.2-py3-none-any.whl", upload-time = 2024-04-23T18:57:14Z, size = 587408, hashes = { sha256 = "dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2" } }]
170+
version = "0.22.4"
171+
sdist = { url = "https://files.pythonhosted.org/packages/ae/b6/03bb70946330e88ffec97aefd3ea75ba575cb2e762061e0e62a213befee8/docutils-0.22.4.tar.gz", upload-time = 2025-12-18T19:00:26Z, size = 2291750, hashes = { sha256 = "4db53b1fde9abecbb74d91230d32ab626d94f6badfc575d6db9194a49df29968" } }
172+
wheels = [{ url = "https://files.pythonhosted.org/packages/02/10/5da547df7a391dcde17f59520a231527b8571e6f46fc8efb02ccb370ab12/docutils-0.22.4-py3-none-any.whl", upload-time = 2025-12-18T19:00:18Z, size = 633196, hashes = { sha256 = "d0013f540772d1420576855455d050a2180186c91c15779301ac2ccb3eeb68de" } }]
173173

174174
[[packages]]
175175
name = "idna"
@@ -236,12 +236,6 @@ version = "4.1.0"
236236
sdist = { url = "https://files.pythonhosted.org/packages/ae/f9/41dc953bbeb056c17d5f7a519f50fdf010bd0553be2d630bc69d1e022703/roman_numerals-4.1.0.tar.gz", upload-time = 2025-12-17T18:25:34Z, size = 9077, hashes = { sha256 = "1af8b147eb1405d5839e78aeb93131690495fe9da5c91856cb33ad55a7f1e5b2" } }
237237
wheels = [{ url = "https://files.pythonhosted.org/packages/04/54/6f679c435d28e0a568d8e8a7c0a93a09010818634c3c3907fc98d8983770/roman_numerals-4.1.0-py3-none-any.whl", upload-time = 2025-12-17T18:25:33Z, size = 7676, hashes = { sha256 = "647ba99caddc2cc1e55a51e4360689115551bf4476d90e8162cf8c345fe233c7" } }]
238238

239-
[[packages]]
240-
name = "roman-numerals-py"
241-
version = "4.1.0"
242-
sdist = { url = "https://files.pythonhosted.org/packages/cb/b5/de96fca640f4f656eb79bbee0e79aeec52e3e0e359f8a3e6a0d366378b64/roman_numerals_py-4.1.0.tar.gz", upload-time = 2025-12-17T18:25:41Z, size = 4274, hashes = { sha256 = "f5d7b2b4ca52dd855ef7ab8eb3590f428c0b1ea480736ce32b01fef2a5f8daf9" } }
243-
wheels = [{ url = "https://files.pythonhosted.org/packages/27/2c/daca29684cbe9fd4bc711f8246da3c10adca1ccc4d24436b17572eb2590e/roman_numerals_py-4.1.0-py3-none-any.whl", upload-time = 2025-12-17T18:25:40Z, size = 4547, hashes = { sha256 = "553114c1167141c1283a51743759723ecd05604a1b6b507225e91dc1a6df0780" } }]
244-
245239
[[packages]]
246240
name = "snowballstemmer"
247241
version = "2.2.0"
@@ -250,9 +244,9 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/ed/dc/c02e01294f7265e
250244

251245
[[packages]]
252246
name = "sphinx"
253-
version = "8.2.3"
254-
sdist = { url = "https://files.pythonhosted.org/packages/38/ad/4360e50ed56cb483667b8e6dadf2d3fda62359593faabbe749a27c4eaca6/sphinx-8.2.3.tar.gz", upload-time = 2025-03-02T22:31:59Z, size = 8321876, hashes = { sha256 = "398ad29dee7f63a75888314e9424d40f52ce5a6a87ae88e7071e80af296ec348" } }
255-
wheels = [{ url = "https://files.pythonhosted.org/packages/31/53/136e9eca6e0b9dc0e1962e2c908fbea2e5ac000c2a2fbd9a35797958c48b/sphinx-8.2.3-py3-none-any.whl", upload-time = 2025-03-02T22:31:56Z, size = 3589741, hashes = { sha256 = "4405915165f13521d875a8c29c8970800a0141c14cc5416a38feca4ea5d9b9c3" } }]
247+
version = "9.1.1"
248+
sdist = { url = "https://files.pythonhosted.org/packages/fc/73/567727fc8c8d85bc3adc88a246e12937cfda8d565cf1d80e85bceaa61fe5/sphinx-9.1.1.tar.gz", upload-time = 2026-10-20T00:41:13Z, size = 8725638, hashes = { sha256 = "48b627f02908f22c601b3ba9c7b17265b4f315dd05c8bc64cd4da41183f44fbc" } }
249+
wheels = [{ url = "https://files.pythonhosted.org/packages/47/18/3c66ea76da7de47e716b181c35bdbfafbd5e9af0bb247b14578e9de348e9/sphinx-9.1.1-py3-none-any.whl", upload-time = 2026-10-20T00:41:11Z, size = 3923559, hashes = { sha256 = "f8b60013ce25017be41a509e5c2d265bc1918410061315c36b809c7f335646c0" } }]
256250

257251
[[packages]]
258252
name = "sphinx-linklint"

‎Doc/requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# won't suddenly cause build failures. Updating the version is fine as long
88
# as no warnings are raised by doing so.
99
# Keep this version in sync with ``Doc/conf.py``.
10-
sphinx<9.0.0
10+
sphinx~=9.1.1
1111

1212
pygments>=2.21
1313

‎Lib/asyncio/base_events.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ def __init__(self):
432432
# Identifier of the thread running the event loop, or None if the
433433
# event loop is not running
434434
self._thread_id = None
435-
self._clock_resolution = time.get_clock_info('monotonic').resolution
436435
self._exception_handler = None
437436
self.set_debug(coroutines._is_debug_mode())
438437
# The preserved state of async generator hooks.
@@ -2057,7 +2056,7 @@ def _run_once(self):
20572056
now = self.time()
20582057
# Ensure that `end_time` is strictly increasing
20592058
# when the clock resolution is too small.
2060-
end_time = now + max(self._clock_resolution, math.ulp(now))
2059+
end_time = now + max(constants.CLOCK_RESOLUTION, math.ulp(now))
20612060
while self._scheduled:
20622061
handle = self._scheduled[0]
20632062
if handle._when >= end_time:

‎Lib/asyncio/constants.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-FileCopyrightText: Copyright (c) 2015-2021 MagicStack Inc. http://magic.io
44

55
import enum
6+
import time
67

78
# After the connection is lost, log warnings after this many write()s.
89
LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5
@@ -33,6 +34,9 @@
3334
# Default timeout for joining the threads in the threadpool
3435
THREAD_JOIN_TIMEOUT = 300
3536

37+
# Resolution of the clock used by the event loop, in seconds.
38+
CLOCK_RESOLUTION = time.get_clock_info('monotonic').resolution
39+
3640
# The enum should be here to break circular dependencies between
3741
# base_events and sslproto
3842
class _SendfileMode(enum.Enum):

‎Lib/asyncio/sslproto.py‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ def close(self):
114114
if not self._closed:
115115
self._closed = True
116116
self._ssl_protocol._start_shutdown()
117-
else:
118-
self._ssl_protocol = None
119117

120118
def __del__(self, _warnings=warnings):
121119
if not self._closed:
@@ -412,12 +410,14 @@ def connection_lost(self, exc):
412410
# The app protocol gets connection_lost() only if it got
413411
# connection_made(). After start_tls() that is already the case
414412
# while the handshake is in progress.
413+
app_notified = False
415414
if (
416415
self._app_state == AppProtocolState.STATE_CON_MADE or
417416
self._app_state == AppProtocolState.STATE_EOF
418417
):
419418
self._app_state = AppProtocolState.STATE_CON_LOST
420419
self._loop.call_soon(self._app_protocol.connection_lost, exc)
420+
app_notified = True
421421
self._set_state(SSLProtocolState.UNWRAPPED)
422422
self._transport = None
423423
self._app_transport = None
@@ -430,6 +430,21 @@ def connection_lost(self, exc):
430430
if self._handshake_timeout_handle:
431431
self._handshake_timeout_handle.cancel()
432432
self._handshake_timeout_handle = None
433+
if app_notified:
434+
# After the app protocol's connection_lost() (scheduled above),
435+
# so that it can still read the TLS extra info.
436+
self._loop.call_soon(self._release_tls_state)
437+
else:
438+
self._release_tls_state()
439+
440+
def _release_tls_state(self):
441+
# The connection is gone: drop everything that refers to the
442+
# SSLContext, so that an application holding the transport does
443+
# not keep the context alive.
444+
self._sslobj = None
445+
self._sslcontext = None
446+
self._extra.pop('sslcontext', None)
447+
self._extra.pop('ssl_object', None)
433448

434449
def get_buffer(self, n):
435450
want = n

‎Lib/ensurepip/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
__all__ = ["version", "bootstrap"]
13-
_PIP_VERSION = "26.2.2"
13+
_PIP_VERSION = "26.3"
1414

1515
# Directory of system wheel packages. Some Linux distribution packaging
1616
# policies recommend against bundling dependencies. For example, Fedora
1.74 MB
Binary file not shown.

‎Lib/sysconfig/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def _get_sysconfigdata():
369369

370370

371371
def _installation_is_relocated():
372-
"""Is the Python installation running from a different prefix than what was targetted when building?"""
372+
"""Is the Python installation running from a different prefix than what was targeted when building?"""
373373
if os.name != 'posix':
374374
raise NotImplementedError('sysconfig._installation_is_relocated() is currently only supported on POSIX')
375375

‎Lib/test/test_asyncio/test_eager_task_factory.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ def test_staggered_race_with_eager_tasks(self):
217217
# See https://github.com/python/cpython/issues/124309
218218

219219
async def fail():
220-
await asyncio.sleep(0)
220+
# Raise without suspending: staggered_race() cancels unfinished
221+
# coroutines once another one wins, so yielding first could turn
222+
# this into a CancelledError when the event loop is busy.
221223
raise ValueError("no good")
222224

223225
async def blocked():

‎Lib/test/test_asyncio/test_events.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import tty
2828

2929
import asyncio
30+
from asyncio import constants
3031
from asyncio import coroutines
3132
from asyncio import events
3233
from asyncio import selector_events
@@ -2314,7 +2315,7 @@ async def wait():
23142315
# of the clock used by the kernel. Tolerate a few useless calls on
23152316
# these platforms.
23162317
self.assertLessEqual(self.loop._run_once_counter, 20,
2317-
{'clock_resolution': self.loop._clock_resolution,
2318+
{'clock_resolution': constants.CLOCK_RESOLUTION,
23182319
'selector': self.loop._selector.__class__.__name__})
23192320

23202321
def test_remove_fds_after_closing(self):

0 commit comments

Comments
 (0)