Title: `asyncio.Timeout.__aexit__` does not handle `BaseExceptionGroup` · Issue #137549 · python/cpython · GitHub
Open Graph Title: `asyncio.Timeout.__aexit__` does not handle `BaseExceptionGroup` · Issue #137549 · python/cpython
X Title: `asyncio.Timeout.__aexit__` does not handle `BaseExceptionGroup` · Issue #137549 · python/cpython
Description: Bug report Bug description: There may be a good reason for this I am not seeing, but in the asyncio.Timeout.__aexit__ handler, the exception group handling seems too narrow: cpython/Lib/asyncio/timeouts.py Lines 113 to 119 in 9743d06 if ...
Open Graph Description: Bug report Bug description: There may be a good reason for this I am not seeing, but in the asyncio.Timeout.__aexit__ handler, the exception group handling seems too narrow: cpython/Lib/asyncio/tim...
X Description: Bug report Bug description: There may be a good reason for this I am not seeing, but in the asyncio.Timeout.__aexit__ handler, the exception group handling seems too narrow: cpython/Lib/asyncio/tim...
Opengraph URL: https://github.com/python/cpython/issues/137549
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`asyncio.Timeout.__aexit__` does not handle `BaseExceptionGroup`","articleBody":"# Bug report\n\n### Bug description:\n\nThere may be a good reason for this I am not seeing, but in the `asyncio.Timeout.__aexit__` handler, the exception group handling seems too narrow:\n\nhttps://github.com/python/cpython/blob/9743d069bd53e9d3a8f09df899ec1c906a79da24/Lib/asyncio/timeouts.py#L113-L119\n\nGiven `exc_val` itself can be a `BaseException` and `_insert_timeout_error` takes a `BaseException` as an argument, I fail to see a reason not to check for superclass `BaseExceptionGroup` instead.\n\nhttps://github.com/python/cpython/blob/9743d069bd53e9d3a8f09df899ec1c906a79da24/Lib/asyncio/timeouts.py#L133\n\nThis no longer impacts me as I implemented what I was aiming for in a better way, but it still looks like a bug. Is it?\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-137797\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/PLPeeters","@type":"Person","name":"PLPeeters"},"datePublished":"2025-08-08T11:58:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/137549/cpython/issues/137549"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c35bc0a1-cee3-ef0a-352e-7ea738e27c54 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D64:1C99EC:6EA887:9A43DC:696A2847 |
| html-safe-nonce | b1d7f3edaa967f52aa697ba9b0c7b9b497d8490f710c7a6f1ef4e5ba9c033ebe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDY0OjFDOTlFQzo2RUE4ODc6OUE0M0RDOjY5NkEyODQ3IiwidmlzaXRvcl9pZCI6IjM5NjMxMzYwOTcyNTUwNDEwOTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ed9a3fdf79c6c2578ab92ae209db10209a0ff26caa291d5281cf5a2deec4ec43 |
| hovercard-subject-tag | issue:3303775159 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/137549/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5599a9c2586d194518dd042f5a32fe9d778b223a651233719abbeabef9ae4d45/python/cpython/issues/137549 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5599a9c2586d194518dd042f5a32fe9d778b223a651233719abbeabef9ae4d45/python/cpython/issues/137549 |
| og:image:alt | Bug report Bug description: There may be a good reason for this I am not seeing, but in the asyncio.Timeout.__aexit__ handler, the exception group handling seems too narrow: cpython/Lib/asyncio/tim... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PLPeeters |
| hostname | github.com |
| expected-hostname | github.com |
| None | a1022f03e4f0d91ea173e4e5dac892c982e0588c62f1ce56121d755a320a3569 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f472b8e6c7b3fdd5d0354972a3f4c516289bf0be |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width