python / python/cpython

subprocess.Popen: warnings.warn() calls missing stacklevel=2

未关闭
#148,402 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

stdlib topic-multiprocessing type-bug
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

Both warnings.warn() calls in subprocess.Popen.__init__ are missing stacklevel=2:

  1. POSIX path (line 915): Warning when pass_fds overrides close_fds
  2. Windows path (line 1569): Warning when startupinfo.lpAttributeList['handle_list'] overrides close_fds

Without stacklevel=2, the warning points to an internal line inside subprocess.py rather than the caller's Popen() invocation, making it harder for users to locate the source.

PR: #148400

Linked PRs
  • gh-148400
  • gh-148668

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 subprocess.py 中第 915 行和第 1569 行所标识的 POSIX 和 Windows warnings.warn() 调用开始,并查看 PR #148400 以了解现有工作。当两个警告都指向 caller 的 Popen() 调用,而不是 subprocess.py 中的内部行时,此更改即完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
operating-systems
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。