`_remote_debugging`: incorrect docstring `get_all_awaited_by()`
未关闭
还没有人认领这个 Issue。
docs
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
Documentation
While writing a reproduction for #149230, I noted that get_all_awaited_by
docstring does not match reality:
It's not a list of [frames, task_name, subtasks] but (thread_id, awaited_by).
Reproduction
2026-05-03T01:17:12.666835000+0200 maurycy@gimel /Users/maurycy/src/github.com/maurycy/cpython (main 6b632ce?) % cat żółtagęślajaźń.py
import asyncio
import os
from _remote_debugging import RemoteUnwinder
from pprint import pp
async def main():
asyncio.create_task(asyncio.sleep(60), name="jaźńżółtejgęsi")
await asyncio.sleep(0)
pp(RemoteUnwinder(os.getpid()).get_all_awaited_by())
if __name__ == "__main__":
asyncio.run(main())
2026-05-03T01:17:14.997344000+0200 maurycy@gimel /Users/maurycy/src/github.com/maurycy/cpython (main 6b632ce?) % uv run --python ./python.exe --with rich żółtagęślajaźń.py
[_remote_debugging.AwaitedInfo(thread_id=15788487, awaited_by=[_remote_debugging.TaskInfo(task_id=4399457888, task_name='Task-1', coroutine_stack=[_remote_debugging.CoroInfo(call_stack=[_remote_debugging.FrameInfo(filename='/Users/maurycy/src/github.com/maurycy/cpython/żółtagęślajaźń.py', location=_remote_debugging.LocationInfo(lineno=10, end_lineno=10, col_offset=7, end_col_offset=55), funcname='main', opcode=None)], task_name=4399457888)], awaited_by=[]), _remote_debugging.TaskInfo(task_id=4399407440, task_name='jaźńżółtejgęsi', coroutine_stack=[_remote_debugging.CoroInfo(call_stack=[_remote_debugging.FrameInfo(filename='/Users/maurycy/src/github.com/maurycy/cpython/Lib/asyncio/tasks.py', location=_remote_debugging.LocationInfo(lineno=702, end_lineno=702, col_offset=15, end_col_offset=27), funcname='sleep', opcode=None)], task_name=4399407440)], awaited_by=[])]),
_remote_debugging.AwaitedInfo(thread_id=0, awaited_by=[])]
Linked PRs
- gh-149312
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 Modules/_remote_debugging/module.c 的第 702–741 行开始,并将 get_all_awaited_by() 的 docstring 与复现输出进行比较。完成的标准是文档准确描述返回的 AwaitedInfo 值及其 thread_id 和 awaited_by 字段;gh-149312 已经关联到此 issue。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 25/100