[Bug]: error messages and warnings should consistently go to stderr
还没有人认领这个 Issue。
评估
调研方向
从 linode-cli linodes create ... --json 所执行的命令路径开始,重现一直到 jq -r .[].id 的管道流程。跟踪所显示的默认值警告在哪里输出,并验证成功的 JSON 保留在 stdout 上,而警告和错误发送到 stderr。完成的标准是管道在警告未污染其输入的情况下产生 12345678。
由索引模型根据 Issue 内容生成。
描述
CLI Version
linode-cli v5.51.0 Built from spec version 4.176.0
Command
linode-cli linodes create [...args...] --json | jq -r .[].id
Output
parse error: Invalid numeric literal at line 1, column 6
Expected Behavior
12345678
Actual Behavior
The problem occurs because linode-cli prints warnings and error messages to stdout. In this case, the (successful) command prints
Using default values: {'authorized_users': ['jschauma']}; use the --no-defaults flag to disable defaults
to stdout before printing the json output. This then leads to tools not being able to consume the output as expected.
The correct behavior here is to send all error messages and warnings to stderr, like a good little Unix tool.
Steps to Reproduce
linode-cli linodes create [...args that produce a warning...] --json | jq -r .[].id
- 主要语言
- Python
- 星标
- 442
- 派生
- 158
- 平均合并
- 3 天 6 小时
- 30 天内合并 PR
- 4
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linode/linode-cli 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
linode/linode-cli#894 ·
-
enhancement
难度 1/5 1 小时以内 新手友好度 85/100
linode/linode-cli#859 · 1 条评论 ·
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
linode/linode-cli#868 ·
-
bug
难度 3/5 1-2 天 新手友好度 45/100
linode/linode-cli#825 · 1 条评论 ·
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
linode/linode-cli#788 ·
查看 linode/linode-cli 的全部 Issue
相似的 Issue
-
feature:LinkChecker
难度 2/5 1-3 小时 新手友好度 66/100
digitalfabrik/integreat-cms#4594 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
EleutherAI/lm-evaluation-harness#4319 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")可能已有人在做 @mayureshsonawane17 今天认领。 未关闭Waiting for: Product Owner
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 5 天内回复