Title: `python -m asyncio ps` fails if any task name is longer than 255 characters · Issue #157788 · python/cpython · GitHub
Open Graph Title: `python -m asyncio ps` fails if any task name is longer than 255 characters · Issue #157788 · python/cpython
X Title: `python -m asyncio ps` fails if any task name is longer than 255 characters · Issue #157788 · python/cpython
Description: Bug report Bug description: One task name longer than 255 characters makes python -m asyncio ps fail for the whole process. The length limit is treated as a validity check instead of a cap. Repro: import asyncio import os from _remote_de...
Open Graph Description: Bug report Bug description: One task name longer than 255 characters makes python -m asyncio ps fail for the whole process. The length limit is treated as a validity check instead of a cap. Repro: ...
X Description: Bug report Bug description: One task name longer than 255 characters makes python -m asyncio ps fail for the whole process. The length limit is treated as a validity check instead of a cap. Repro: ...
Opengraph URL: https://github.com/python/cpython/issues/157788
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`python -m asyncio ps` fails if any task name is longer than 255 characters","articleBody":"# Bug report\n\n### Bug description:\n\nOne task name longer than 255 characters makes `python -m asyncio ps` fail for the whole process. The length limit is treated as a validity check instead of a cap.\n\nRepro:\n\n```python\n import asyncio\n import os\n from _remote_debugging import RemoteUnwinder\n\n async def main():\n asyncio.create_task(asyncio.sleep(10), name='x' * 256)\n await asyncio.sleep(0)\n print(RemoteUnwinder(os.getpid()).get_all_awaited_by())\n\n asyncio.run(main())\n```\n\nActually:\n\n```\n Traceback (most recent call last):\n File \"/Users/timofeiivankov/cpython/repro.py\", line 10, in \u003cmodule>\n asyncio.run(main())\n ~~~~~~~~~~~^^^^^^^^\n File \"/Users/timofeiivankov/cpython/Lib/asyncio/runners.py\", line 205, in run\n return runner.run(main)\n ~~~~~~~~~~^^^^^^\n File \"/Users/timofeiivankov/cpython/Lib/asyncio/runners.py\", line 128, in run\n return self._loop.run_until_complete(task)\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n File \"/Users/timofeiivankov/cpython/Lib/asyncio/base_events.py\", line 725, in run_until_complete\n return future.result()\n ~~~~~~~~~~~~~^^\n File \"/Users/timofeiivankov/cpython/repro.py\", line 8, in main\n print(RemoteUnwinder(os.getpid()).get_all_awaited_by())\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^\n RuntimeError: Invalid string length (256) at 0x101493800\n```\n\nExpected: the call returns and the long name comes back truncated:\n\n```\n[AwaitedInfo(thread_id=21170325, awaited_by=[\n TaskInfo(task_id=4312485712, task_name='Task-1', ...),\n TaskInfo(task_id=4312485232, task_name='xxx…' (truncated to 255), ...)])]\n```\n\nProposed fix: Truncate to the limit instead of raising in `object_reading.c`\n\nI have a fix ready for that\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-157790\n* gh-157843\n* gh-157826\n* gh-157911\n* gh-157941\n* gh-157942\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/deadlovelll","@type":"Person","name":"deadlovelll"},"datePublished":"2026-09-19T11:08:04Z","url":"https://github.com/python/cpython/issues/157788"}
| 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:eae8edae-3b0e-1b2e-088d-159454a7b9f6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E3E4:1FE434:1BC6366:249660A:6B02201B |
| html-safe-nonce | e373b9fb268d3c53be7830409556919b1ec6ea5275954d1b3cc0844d1c48e8cb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0U0OjFGRTQzNDoxQkM2MzY2OjI0OTY2MEE6NkIwMjIwMUIiLCJ2aXNpdG9yX2lkIjoiMTQyNjU3MzU2OTU1MDMyNzgzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 05d84de24df9d4096e773dae4bd38810c542652c30b8fe903dfa5fa367b9931c |
| hovercard-subject-tag | issue:5509658178 |
| 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/157788/issue_layout |
| twitter:image | https://opengraph.githubassets.com/66d31d5081db68d1ab70d40442381f499639b8d0d6e9ccd99d679280388de036/python/cpython/issues/157788 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/66d31d5081db68d1ab70d40442381f499639b8d0d6e9ccd99d679280388de036/python/cpython/issues/157788 |
| og:image:alt | Bug report Bug description: One task name longer than 255 characters makes python -m asyncio ps fail for the whole process. The length limit is treated as a validity check instead of a cap. Repro: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | deadlovelll |
| 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