diff options
| author | Yunlk <[email protected]> | 2026-10-21 00:12:27 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-10-22 18:00:03 +0800 |
| commit | 2f7aba80fbbe3e3e44997dfe9819665f01a82534 (patch) | |
| tree | 5e5857fc6b5a30675765b6fc073e2c286331a9ff | |
| parent | e7c293802a3eaef0761a2fea6244382ae42ed00f (diff) | |
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 #11906
| -rw-r--r-- | tools/attachconfig.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/attachconfig.py b/tools/attachconfig.py index df89fd23c3..d5a77fb68b 100644 --- a/tools/attachconfig.py +++ b/tools/attachconfig.py @@ -15,7 +15,7 @@ def GenAttachConfigProject(program = None): if GetOption('attach') == '?': attachconfig=[] GetAttachConfig("get",attachconfig,0) - print("\033[32m✅ AttachConfig has: \033[0m") + print("\033[32m[OK] AttachConfig has: \033[0m") prefix=attachconfig[0] for line in attachconfig: temp_prefix=line.split(".", 1) @@ -32,13 +32,13 @@ def GenAttachConfigProject(program = None): if os.path.exists(rtconfig__bacakup): shutil.copyfile(rtconfig__bacakup, rtconfig_file) os.remove(rtconfig__bacakup) - print("\033[32m✅ Default .config and rtconfig.h recovery success!\033[0m") + print("\033[32m[OK] Default .config and rtconfig.h recovery success!\033[0m") else: attachconfig=GetOption('attach') attachconfig_result=[] GetAttachConfig("search",attachconfig,attachconfig_result) if attachconfig_result==[]: - print("❌\033[31m Without this AttachConfig:"+attachconfig+"\033[0m") + print("[ERR]\033[31m Without this AttachConfig:"+attachconfig+"\033[0m") return if os.path.exists(config_bacakup)==False: shutil.copyfile(config_file, config_bacakup) @@ -49,7 +49,7 @@ def GenAttachConfigProject(program = None): destination.write(line + '\n') from env_utility import defconfig defconfig(Rtt_Root) - print("\033[32m✅ AttachConfig add success!\033[0m") + print("\033[32m[OK] AttachConfig add success!\033[0m") def GetAttachConfig(action,attachconfig,attachconfig_result): rtt_root = os.getcwd() |
