Unify interpretation of values of environment variables and CLI options
未关闭
还没有人认领这个 Issue。
type-feature
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
There is inconsistency in interpreting values of different environment variables that have equivalent of CLI options.
- For some environment variables, defining them with any values (even empty) is interpreted as true.
- For some environment variables, any values except 0 (including non-numbers and empty value) are interpreted as true. Only 0 is interpreted as false. For some of these variables it makes sense to set integer value > 1, but for other they are just booleans.
- PYTHONUTF8 and PYTHON_GIL only accept "1" and "0". All other values are errors. Although the code for these two variables is very different.
- PYTHON_FROZEN_MODULES only accepts "on" and "off". All other values are errors.
- PYTHONCOERCECLOCALE has three state: "0", "warn" and... anything other.
- Some environment variables has "0" as a special value, but PYTHON_CPU_COUNT uses "default".
There are similar things for corresponding CLI options which accept optional arguments.
Such diversity makes it difficult to document and use environment variables and CLI options. It can lead to subtle bugs if "0" is interpreted differently. An empty value of the environment variable can be the result of a hidden bug, but in most cases it is currently silently accepted and interpreted as true value.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,盘点 issue 中描述的环境变量及其对应的 CLI 选项,比较它们当前对空值、数值、布尔值和无效值的处理方式。实现之前需要先就解释策略达成一致。完成的标准是:列出的环境变量及其对应的 CLI 选项遵循一致的规则,包括对无效值的一致处理。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100