Title: asyncio internals throw `RuntimeError: Event loop is closed` on script exit · Issue #92841 · python/cpython · GitHub
Open Graph Title: asyncio internals throw `RuntimeError: Event loop is closed` on script exit · Issue #92841 · python/cpython
X Title: asyncio internals throw `RuntimeError: Event loop is closed` on script exit · Issue #92841 · python/cpython
Description: Actual behavior >>> import asyncio >>> import aiohttp >>> >>> async def main(): ... async with aiohttp.ClientSession() as session: ... async with session.get('https://example.com/'): ... pass ... >>> asyncio.run(main()) >>> exit() Except...
Open Graph Description: Actual behavior >>> import asyncio >>> import aiohttp >>> >>> async def main(): ... async with aiohttp.ClientSession() as session: ... async with session.get('https://example.com/'): ... pass ... >...
X Description: Actual behavior >>> import asyncio >>> import aiohttp >>> >>> async def main(): ... async with aiohttp.ClientSession() as session: ... async with session.get(...
Opengraph URL: https://github.com/python/cpython/issues/92841
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"asyncio internals throw `RuntimeError: Event loop is closed` on script exit","articleBody":"**Actual behavior**\r\n\r\n```python\r\n>>> import asyncio\r\n>>> import aiohttp\r\n>>>\r\n>>> async def main():\r\n... async with aiohttp.ClientSession() as session:\r\n... async with session.get('https://example.com/'):\r\n... pass\r\n...\r\n>>> asyncio.run(main())\r\n>>> exit()\r\nException ignored in: \u003cfunction _ProactorBasePipeTransport.__del__ at 0x0000017BF133F760>\r\nTraceback (most recent call last):\r\n File \"C:\\Program Files\\Python310\\lib\\asyncio\\proactor_events.py\", line 116, in __del__\r\n self.close()\r\n File \"C:\\Program Files\\Python310\\lib\\asyncio\\proactor_events.py\", line 108, in close\r\n self._loop.call_soon(self._call_connection_lost, None)\r\n File \"C:\\Program Files\\Python310\\lib\\asyncio\\base_events.py\", line 750, in call_soon\r\n self._check_closed()\r\n File \"C:\\Program Files\\Python310\\lib\\asyncio\\base_events.py\", line 515, in _check_closed\r\n raise RuntimeError('Event loop is closed')\r\nRuntimeError: Event loop is closed\r\n```\r\n\r\n*This issue was reported in aio-libs/aiohttp#4324 so the reproducer is copied from there.*\r\n\r\n**Expected behavior**\r\n\r\nNormal exit without termination. There is no user-created loop to be closed manually.\r\n\r\n**Your environment**\r\n\r\n\u003c!-- Include as many relevant details as possible about the environment you experienced the bug in -->\r\n\r\n- CPython versions tested on: 3.10.4\r\n- Operating system and architecture: Windows 10","author":{"url":"https://github.com/arhadthedev","@type":"Person","name":"arhadthedev"},"datePublished":"2022-05-16T08:43:46Z","url":"https://github.com/python/cpython/issues/92841"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:946b9a86-687d-dc8c-8880-318f6c27dbc7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 813A:157C65:341A0F8:457C2EF:6B020240 |
| html-safe-nonce | c78c3a17408a4812a69a4f667695b67d772edf033e14b0c165a2ae023d505aed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTNBOjE1N0M2NTozNDFBMEY4OjQ1N0MyRUY6NkIwMjAyNDAiLCJ2aXNpdG9yX2lkIjoiNTc3OTkxNTA2MzE1MDM3OTU4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0e62a2f333850b345dc8d03f99c18f3ab385d119ad150fdf7acfc661c1fb3fc9 |
| hovercard-subject-tag | issue:1236822747 |
| 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/92841/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7366977ec1533166d0164a7788cb6789ad4dfa4f18fba959bdac9e2fe197bbb/python/cpython/issues/92841 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7366977ec1533166d0164a7788cb6789ad4dfa4f18fba959bdac9e2fe197bbb/python/cpython/issues/92841 |
| og:image:alt | Actual behavior >>> import asyncio >>> import aiohttp >>> >>> async def main(): ... async with aiohttp.ClientSession() as session: ... async with session.get('https://example.com/'): ... pass ... >... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arhadthedev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width