python
runtime_error
ai_generated
true
ExceptionGroup: unhandled errors in a TaskGroup
ID: python/asyncio-task-group-exception
80%Fix Rate
84%Confidence
0Evidence
2024-07-22First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.11 | active | — | — | — |
Root Cause
Multiple exceptions raised in asyncio.TaskGroup are aggregated into ExceptionGroup, requiring special handling.
generic中文
asyncio.TaskGroup 中多个异常被聚合为 ExceptionGroup,需要特殊处理。
Workarounds
-
90% success
except* Exception: # handle all exceptions in group
-
85% success
for ex in eg.exceptions: # iterate and handle individually
Dead Ends
Common approaches that don't work:
- 80% fail
- 50% fail