@@ -196,13 +196,6 @@ Other Language Changes
196196
197197 (Contributed by Sebastian Pipping in :gh: `115623 `.)
198198
199- * When :func: `asyncio.TaskGroup.create_task ` is called on an inactive
200- :class: `asyncio.TaskGroup `, the given coroutine will be closed (which
201- prevents a :exc: `RuntimeWarning ` about the given coroutine being
202- never awaited).
203-
204- (Contributed by Arthur Tacca and Jason Zhang in :gh: `115957 `.)
205-
206199* The :func: `ssl.create_default_context ` API now includes
207200 :data: `ssl.VERIFY_X509_PARTIAL_CHAIN ` and :data: `ssl.VERIFY_X509_STRICT `
208201 in its default flags.
@@ -300,6 +293,33 @@ asyncio
300293 with the tasks being completed.
301294 (Contributed by Justin Arthur in :gh: `77714 `.)
302295
296+ * When :func: `asyncio.TaskGroup.create_task ` is called on an inactive
297+ :class: `asyncio.TaskGroup `, the given coroutine will be closed (which
298+ prevents a :exc: `RuntimeWarning ` about the given coroutine being
299+ never awaited).
300+ (Contributed by Arthur Tacca and Jason Zhang in :gh: `115957 `.)
301+
302+ * Improved behavior of :class: `asyncio.TaskGroup ` when an external cancellation
303+ collides with an internal cancellation. For example, when two task groups
304+ are nested and both experience an exception in a child task simultaneously,
305+ it was possible that the outer task group would hang, because its internal
306+ cancellation was swallowed by the inner task group.
307+
308+ In the case where a task group is cancelled externally and also must
309+ raise an :exc: `ExceptionGroup `, it will now call the parent task's
310+ :meth: `~asyncio.Task.cancel ` method. This ensures that a
311+ :exc: `asyncio.CancelledError ` will be raised at the next
312+ :keyword: `await `, so the cancellation is not lost.
313+
314+ An added benefit of these changes is that task groups now preserve the
315+ cancellation count (:meth: `asyncio.Task.cancelling `).
316+
317+ In order to handle some corner cases, :meth: `asyncio.Task.uncancel ` may now
318+ reset the undocumented ``_must_cancel `` flag when the cancellation count
319+ reaches zero.
320+
321+ (Inspired by an issue reported by Arthur Tacca in :gh: `116720 `.)
322+
303323* Add :meth: `asyncio.Queue.shutdown ` (along with
304324 :exc: `asyncio.QueueShutDown `) for queue termination.
305325 (Contributed by Laurie Opperman and Yves Duprat in :gh: `104228 `.)
0 commit comments