Skip to content

Commit 9e5b991

Browse files
committed
Merge remote-tracking branch 'upstream/main' into jumps
2 parents a052d10 + 2b3e02a commit 9e5b991

File tree

7 files changed

+189
-115
lines changed

7 files changed

+189
-115
lines changed

Doc/library/asyncio-stream.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ StreamWriter
335335
returns immediately.
336336

337337
.. coroutinemethod:: start_tls(sslcontext, \*, server_hostname=None, \
338-
ssl_handshake_timeout=None)
338+
ssl_handshake_timeout=None, ssl_shutdown_timeout=None)
339339

340340
Upgrade an existing stream-based connection to TLS.
341341

@@ -350,8 +350,16 @@ StreamWriter
350350
handshake to complete before aborting the connection. ``60.0`` seconds
351351
if ``None`` (default).
352352

353+
* *ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown
354+
to complete before aborting the connection. ``30.0`` seconds if ``None``
355+
(default).
356+
353357
.. versionadded:: 3.11
354358

359+
.. versionchanged:: 3.12
360+
Added the *ssl_shutdown_timeout* parameter.
361+
362+
355363
.. method:: is_closing()
356364

357365
Return ``True`` if the stream is closed or in the process of

Doc/library/datetime.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ Other constructors, all class methods:
975975
microsecond of the result are all 0, and :attr:`.tzinfo` is ``None``.
976976

977977

978-
.. classmethod:: datetime.combine(date, time, tzinfo=self.tzinfo)
978+
.. classmethod:: datetime.combine(date, time, tzinfo=time.tzinfo)
979979

980980
Return a new :class:`.datetime` object whose date components are equal to the
981981
given :class:`date` object's, and whose time components

Lib/asyncio/streams.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,17 @@ async def drain(self):
378378

379379
async def start_tls(self, sslcontext, *,
380380
server_hostname=None,
381-
ssl_handshake_timeout=None):
381+
ssl_handshake_timeout=None,
382+
ssl_shutdown_timeout=None):
382383
"""Upgrade an existing stream-based connection to TLS."""
383384
server_side = self._protocol._client_connected_cb is not None
384385
protocol = self._protocol
385386
await self.drain()
386387
new_transport = await self._loop.start_tls( # type: ignore
387388
self._transport, protocol, sslcontext,
388389
server_side=server_side, server_hostname=server_hostname,
389-
ssl_handshake_timeout=ssl_handshake_timeout)
390+
ssl_handshake_timeout=ssl_handshake_timeout,
391+
ssl_shutdown_timeout=ssl_shutdown_timeout)
390392
self._transport = new_transport
391393
protocol._replace_writer(self)
392394

Lib/test/test_itertools.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,38 @@ def test_zip_longest_result_gc(self):
16941694
gc.collect()
16951695
self.assertTrue(gc.is_tracked(next(it)))
16961696

1697+
@support.cpython_only
1698+
def test_immutable_types(self):
1699+
from itertools import _grouper, _tee, _tee_dataobject
1700+
dataset = (
1701+
accumulate,
1702+
batched,
1703+
chain,
1704+
combinations,
1705+
combinations_with_replacement,
1706+
compress,
1707+
count,
1708+
cycle,
1709+
dropwhile,
1710+
filterfalse,
1711+
groupby,
1712+
_grouper,
1713+
islice,
1714+
pairwise,
1715+
permutations,
1716+
product,
1717+
repeat,
1718+
starmap,
1719+
takewhile,
1720+
_tee,
1721+
_tee_dataobject,
1722+
zip_longest,
1723+
)
1724+
for tp in dataset:
1725+
with self.subTest(tp=tp):
1726+
with self.assertRaisesRegex(TypeError, "immutable"):
1727+
tp.foobar = 1
1728+
16971729

16981730
class TestExamples(unittest.TestCase):
16991731

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add *ssl_shutdown_timeout* parameter for :meth:`asyncio.StreamWriter.start_tls`.
2+

Modules/clinic/itertoolsmodule.c.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)