python / python/cpython

subprocess.run parameters not fully documented

未关闭
#127,008 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

docs
主要语言
Python
星标
77.2k
派生
36k
PR 合并指标
PR 指标待抓取

描述

https://docs.python.org/3/library/subprocess.html#subprocess.run

So I want to capture STDERR, but it doesn't actually say how to do that anywhere that I can see. Note that I don't want to capture STDOUT.

My IDE is telling me that stderr accepts None and Int types. What are the int values? I'm guessing a PIPE:

subprocess.PIPE
Special value that can be used as the stdin, stdout or stderr argument to Popen and indicates that a pipe to the standard stream should be opened.

Now the user also needs to understand the inner workings of Popen? Why on earth does a user need to join so many dots just to use an arguement? Is not explicit is better than implicit part of the python ethos?

I'm sorry to be blunt, but none of this is well documented. There should be a comprehensive, itemised list of all parameters. Each one should explicitly list what they do and what their possible values are. As it is, it's a confused mess of "if x, then y in module q, but not z in module p".

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 issue 中链接的 subprocess.run 文档开始,将其参数描述与所引用的 Popen 文档进行比较,尤其关注 stderr 和 subprocess.PIPE。完成的标准是:参数及其接受的值都有足够清晰的文档说明,能够解释如何捕获 STDERR,而不要求读者从另一个 API 推断行为。

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

评估

技术栈
python
领域
documentation
Issue 类型
文档
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

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