Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

fix(planning): write share.py output as UTF-8 so Windows pipes don't crash on non-cp1252 text

未关闭 适合新手
#8,239 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, shell
领域
cli, testing

调研方向

从 plugins/planning/shared/share.py 及其 subprocess 测试开始;issue 指出 stdout 和 stderr 的编码问题,以及测试中依赖 locale 的读取操作。使用 PYTHONIOENCODING=cp1252 和包含 → 等字符的日志行重现问题,然后检查 logs 和 logs --summary 的输出。两个命令都成功退出并将该字符保留为 UTF-8,即表示完成;在 pr-test-windows lane 上验证。

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

描述

priority: medium

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 模板
  • 阅读贡献指南

从这里开始

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

melodic-software/claude-code-plugins 的其他 Issue

查看 melodic-software/claude-code-plugins 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

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