PYTHONBREAKPOINT should ignore non-importable breakpoints
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- PR 合并指标
- PR 指标待抓取
描述
Feature or enhancement
Proposal:
I'd like to use ipdb rather than the built-in pdb by default for my breakpoints. However, if I set PYTHONBREAKPOINT="ipdb.set_trace" as a global shell environment variable, and the project does not have ipdb available, then all breakpoints are disabled:
/Users/tomforbes/.../cli.py:144: RuntimeWarning: Ignoring unimportable $PYTHONBREAKPOINT: "ipdb.set_trace"
breakpoint()
IMO this isn't very user-friendly and can be quite annoying: I need to remember to export it on a per-project or per-shell basis. It would be great to fall back to the standard pdb breakpoint handler if the import fails.
If this is a compatability issue, perhaps a new PYTHONDEFAULTBREAKPOINT env variable could be added (and that can be set globally), which is used if available and falls back to pdb if not?
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先跟踪调用 breakpoint() 时 PYTHONBREAKPOINT 的处理方式,包括针对无法导入的 handler 现有的 RuntimeWarning。定义 ipdb.set_trace 不可用时的回退行为,同时保留标准的 pdb handler,并为可导入和不可用的 breakpoint handler 都添加覆盖测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- developer-experience
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100