| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Documentation build overview2 files changed ± library/asyncio-eventloop.html ± whatsnew/changelog.html |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes gh-159303.
With no custom handler set, call_exception_handler() called default_exception_handler() in the caller's context. gh-96704 made a custom handler run in the task's or handle's context, and its PR left the default handler for later. This moves the lookup into a helper and uses it for both.
Both handlers run in ctx.copy(). Without the copy, reporting from inside the task itself ('task': asyncio.current_task()) raises RuntimeError: cannot enter context, and a custom handler is silently skipped today.
Three tests in test_base_events:
The docs note both changes. The issue's repro now prints req-1 twice. ./python -m test --fast-ci -j8 test_asyncio passes.
Prepared with AI assistance (Claude), then reviewed and tested before submission.