Repository navigation
Conversation
scons --attach prints a check mark / cross emoji as status prefix. On
Windows the standard output encoding follows the locale code page (936/GBK
on a Chinese system), which cannot encode U+2705/U+274C, so Python raises
UnicodeEncodeError and the command aborts:
UnicodeEncodeError: 'gbk' codec can't encode character '\u2705'
File "tools/attachconfig.py", line 18, in GenAttachConfigProject
All three commands go through the same function, so --attach=?,
--attach=<name> and --attach=default were all unusable on such systems.
Replace the emoji with plain ASCII markers and keep the existing ANSI colour
codes, which the other scripts under tools/ already use.
Refs RT-Thread#11906
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
MemBrowse 失败的与本 PR 无关,麻烦重跑一次本 PR 的
时间线(本地时间 UTC+8)对得上:
现在 我对 RT-Thread/rt-thread 没有 Actions 重跑权限(接口返回 本 PR 其余检查均为通过状态,未受影响: 本 PR 只改了 |
|
@Rbb666 打扰一下。本 PR 的 我没有本仓库 Actions 的重跑权限(需要写权限),方便的话请帮忙点一次 Re-run failed jobs。 (这条检查不在必需列表里,不影响合并,只是希望 CI 干净。)本 PR 其余检查全部通过,改动仅 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
关联 issue #11906。
scons --attach的三种用法(--attach=?、--attach=<name>、--attach=default)都会先打印一句带 emoji 的状态提示。Windows 上 Python 的 stdout 编码跟随区域代码页,中文系统是 936/GBK,无法编码 U+2705 / U+274C,于是直接抛异常、整个命令中止:因为三条路径都走同一个函数,所以该命令在中文 Windows 上完全不可用。设置
PYTHONIOENCODING=utf-8可以绕过,但普通用户不会知道这个办法。你的解决方案是什么 (what is your solution)
把这 4 处 emoji 换成纯 ASCII 标记(
[OK]/[ERR]),保留原有的 ANSI 颜色码——tools/env_utility.py、tools/ci/bsp_buildings.py等脚本本来就在用 ANSI 彩色输出,属于既有约定。改动仅限
tools/attachconfig.py的 4 行 print,不涉及逻辑。tools/ci/下那些 emoji 是写进 GitHub Actions summary 的 Markdown,由 UTF-8 渲染,不受控制台编码影响,因此未做改动。请提供验证的bsp和config (provide the config and bsp)
.ci/attachconfig/attachconfig.yml的可用目录)修复前后对照(同一终端,未设置
PYTHONIOENCODING):scons --attach=?UnicodeEncodeError中止system.nano / devices.gpio / devices.uart / devices.soft_i2cscons --attach=devices.uartUnicodeEncodeError中止.config并生成.origin备份scons --attach=no.such.configUnicodeEncodeError中止[ERR] Without this AttachConfig:no.such.configscons --attach=defaultUnicodeEncodeError中止git status无变更四条路径的退出码均为 0,执行完
--attach=default后工作区干净。备注:clang-format 相关检查项不适用于 Python 文件;本改动保持与文件内既有代码完全一致的风格(无空格调整、无重排)。
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up