Skip to content

Commit 25b2f2d

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Import CPython 3.14.6+ stable branch (2026-07-25)
Summary: Imported python/cpython `3.14.6+` from upstream rev [`92b0ec6`](https://www.github.com/python/cpython/commit/92b0ec643970933bf87241fd4eeb0fd292f87050) (committed 2026-07-25 13:26:21+00:00). # Commit Info - Base: (`3.14.6+`) - [`e76d333`](https://www.github.com/python/cpython/commit/e76d3333cbfa82e32aa4f8cf0b52d2664e90eb44) (commit date: 2026-07-25 03:56:33+00:00) - Imported: (`3.14.6+`) - [`92b0ec6`](https://www.github.com/python/cpython/commit/92b0ec643970933bf87241fd4eeb0fd292f87050) (commit date: 2026-07-25 13:26:21+00:00) # Noteworthy file changes - Low-signal files (1 added) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GHhCFi1LhrhbJc0EAGztoHEYGzJ6br0LAAAz Reviewed By: itamaro Differential Revision: D113695649 fbshipit-source-id: dd406df27f3dfc5138d2fac1ac94fd531e8ac22f
1 parent 585e0d6 commit 25b2f2d

5 files changed

Lines changed: 92 additions & 0 deletions

File tree

Doc/library/asyncio-eventloop.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,12 @@ Do not instantiate the :class:`Server` class directly.
18841884
Wait until the :meth:`close` method completes and all active
18851885
connections have finished.
18861886

1887+
.. versionchanged:: 3.12
1888+
``wait_closed()`` now waits until the server is closed and
1889+
all active connections have finished. Previously, it returned
1890+
immediately if the server was already closed, even if
1891+
connections were still active.
1892+
18871893
.. attribute:: sockets
18881894

18891895
List of socket-like objects, ``asyncio.trsock.TransportSocket``, which

Doc/license.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,3 +1169,52 @@ contributors. The pyzstd code is distributed under the 3-Clause BSD License::
11691169
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
11701170
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
11711171
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1172+
1173+
1174+
Unicode Character Database
1175+
--------------------------
1176+
1177+
An extract of the `Unicode Character Database <https://www.unicode.org/ucd/>`__,
1178+
converted to an internal format, is used by the :mod:`unicodedata` module and
1179+
for the Unicode support of the :class:`str` type. The original Unicode data
1180+
files are distributed under the `Unicode License <https://www.unicode.org/license.txt>`__::
1181+
1182+
UNICODE LICENSE V3
1183+
1184+
COPYRIGHT AND PERMISSION NOTICE
1185+
1186+
Copyright © 1991-2026 Unicode, Inc.
1187+
1188+
NOTICE TO USER: Carefully read the following legal agreement. BY
1189+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
1190+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
1191+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
1192+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
1193+
1194+
Permission is hereby granted, free of charge, to any person obtaining a
1195+
copy of data files and any associated documentation (the "Data Files") or
1196+
software and any associated documentation (the "Software") to deal in the
1197+
Data Files or Software without restriction, including without limitation
1198+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
1199+
copies of the Data Files or Software, and to permit persons to whom the
1200+
Data Files or Software are furnished to do so, provided that either (a)
1201+
this copyright and permission notice appear with all copies of the Data
1202+
Files or Software, or (b) this copyright and permission notice appear in
1203+
associated Documentation.
1204+
1205+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
1206+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1207+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
1208+
THIRD PARTY RIGHTS.
1209+
1210+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
1211+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
1212+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
1213+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
1214+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
1215+
FILES OR SOFTWARE.
1216+
1217+
Except as contained in this notice, the name of a copyright holder shall
1218+
not be used in advertising or otherwise to promote the sale, use or other
1219+
dealings in these Data Files or Software without prior written
1220+
authorization of the copyright holder.

Lib/asyncio/streams.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ def _replace_transport(self, transport):
217217
loop = self._loop
218218
self._transport = transport
219219
self._over_ssl = transport.get_extra_info('sslcontext') is not None
220+
reader = self._stream_reader
221+
if reader is not None:
222+
reader._replace_transport(transport)
220223

221224
def connection_made(self, transport):
222225
if self._reject_connection:
@@ -477,6 +480,10 @@ def set_transport(self, transport):
477480
assert self._transport is None, 'Transport already set'
478481
self._transport = transport
479482

483+
def _replace_transport(self, transport):
484+
assert self._transport is not None, 'Transport not set'
485+
self._transport = transport
486+
480487
def _maybe_resume_transport(self):
481488
if self._paused and len(self._buffer) <= self._limit:
482489
self._paused = False

Lib/test/test_asyncio/test_streams.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,34 @@ async def run_test():
861861
self.loop.run_until_complete(run_test())
862862
self.assertEqual(messages, [])
863863

864+
def test_streamwriter_start_tls_updates_reader_transport(self):
865+
reader = asyncio.StreamReader(loop=self.loop)
866+
protocol = asyncio.StreamReaderProtocol(reader, loop=self.loop)
867+
old_transport = mock.Mock()
868+
old_transport.get_extra_info.return_value = None
869+
old_transport.is_closing.return_value = False
870+
protocol.connection_made(old_transport)
871+
872+
writer = asyncio.StreamWriter(old_transport, protocol, reader, self.loop)
873+
874+
ssl_context = mock.sentinel.ssl_context
875+
new_transport = mock.Mock()
876+
new_transport.get_extra_info.return_value = ssl_context
877+
self.loop.start_tls = mock.AsyncMock(return_value=new_transport)
878+
879+
self.loop.run_until_complete(writer.start_tls(ssl_context))
880+
881+
self.loop.start_tls.assert_awaited_once_with(
882+
old_transport, protocol, ssl_context,
883+
server_side=False, server_hostname=None,
884+
ssl_handshake_timeout=None,
885+
ssl_shutdown_timeout=None,
886+
)
887+
self.assertIs(writer.transport, new_transport)
888+
self.assertIs(protocol._transport, new_transport)
889+
self.assertIs(reader._transport, new_transport)
890+
self.assertTrue(protocol._over_ssl)
891+
864892
def test_streamreader_constructor_without_loop(self):
865893
with self.assertRaisesRegex(RuntimeError, 'no current event loop'):
866894
asyncio.StreamReader()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ``asyncio.StreamWriter.start_tls()`` to keep the linked
2+
``StreamReader`` transport in sync with the upgraded transport.

0 commit comments

Comments
 (0)