fix(planning): write share.py output as UTF-8 so Windows pipes don't crash on non-cp1252 text
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 plugins/planning/shared/share.py 及其 subprocess 测试开始;issue 指出 stdout 和 stderr 的编码问题,以及测试中依赖 locale 的读取操作。使用 PYTHONIOENCODING=cp1252 和包含 → 等字符的日志行重现问题,然后检查 logs 和 logs --summary 的输出。两个命令都成功退出并将该字符保留为 UTF-8,即表示完成;在 pr-test-windows lane 上验证。
由索引模型根据 Issue 内容生成。
描述
Refs: #7670
Summary
On Windows, share.sh output crashes on a character cp1252 cannot encode, such as an emoji in a name or chat-derived log line, or →. It happens when stdout is a pipe (a terminal pipe, the interview skill reading the output, a test).
Cause
plugins/planning/shared/share.py prints its JSON with ensure_ascii=False, and the logs --summary text as-is. When stdout is a pipe on Windows, Python encodes it in the ANSI code page (cp1252), and an unencodable character raises UnicodeEncodeError. share.sh runs Python with -I, which ignores PYTHONUTF8. Reproduced on Linux with PYTHONIOENCODING=cp1252 and a → in a log line.
Fix
Make share.py write UTF-8 on stdout and stderr explicitly (sys.stdout.reconfigure(encoding="utf-8")), and have the tests and the skill read share.py's output as UTF-8 rather than with the locale default. Verify on the pr-test-windows lane.
Verification
A subprocess test that sets PYTHONIOENCODING=cp1252, logs a line with a non-cp1252 character, and gets exit 0 from share.py logs and logs --summary, with the character intact in UTF-8.
- 主要语言
- Shell
- 星标
- 22
- 派生
- 2
- 平均合并
- 8 小时 44 分钟
- 30 天内合并 PR
- 926
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
melodic-software/claude-code-plugins 的其他 Issue
-
status: ready
难度 2/5 1-3 小时 新手友好度 73/100
melodic-software/claude-code-plugins#8537 ·
维护者通常 1 天内回复
-
priority: medium status: confirmed
难度 2/5 1-3 小时 新手友好度 72/100
melodic-software/claude-code-plugins#8507 · 1 条评论 ·
维护者通常 1 天内回复
-
priority: low
难度 2/5 1-3 小时 新手友好度 82/100
melodic-software/claude-code-plugins#8476 · 1 条评论 ·
维护者通常 1 天内回复
-
area: security needs-human priority: low
难度 2/5 1-3 小时 新手友好度 68/100
melodic-software/claude-code-plugins#8472 · 1 条评论 ·
维护者通常 1 天内回复
-
priority: low
难度 2/5 1-3 小时 新手友好度 72/100
melodic-software/claude-code-plugins#8434 · 1 条评论 ·
维护者通常 1 天内回复
查看 melodic-software/claude-code-plugins 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
package-update
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
jangala-dev/devicecode-lua#344 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
cov-lineages/pangolin#583 · 1 条评论 ·