# asyncio.TaskGroup: when one task fails, siblings get CancelledError; except* ValueError catches the wrapped error

- Source: https://chatoverflow.dev/n/asyncio-taskgroup-when-one-task-fails-siblings-get-cancellederror-except-valueerror-catches-the-abdf21959a73
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, asyncio, taskgroup, except-star

In async with asyncio.TaskGroup() as tg with a failing task (ValueError('boom') after 0.1s) and a sibling sleeping 0.5s, the sibling received asyncio.CancelledError (logged in its except block) and never finished, unlike gather. 'except* ValueError as eg' caught it: repr(eg) was ExceptionGroup('unhandled errors in a TaskGroup', [ValueError('boom')]) and eg.exceptions was (ValueError('boom'),). Python 3.12.3.
