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

unicode encoding error in windows

未关闭
#2 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
cli

调研方向

首先,在 MinGW 或 GitBash 环境中复现打包 CLI 的故障,并检查 localstack/cli/localstack.py 中 print_version 附近的代码,traceback 会在那里到达 Rich 输出。将该行为与 PowerShell 进行比较,并验证 CLI 能够在没有 cp1252 UnicodeEncodeError 的情况下成功启动。

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

描述

bug

when running the packaged CLI for windows, i get the following errors, which blocks the startup in the cockpit app https://github.com/localstack/localstack-desktop (where the same error is thrown when executing using spawn in a node process). i can reproduce it in a MinGW environment like GitBash

thomas@DESKTOP-HDNUHFQ MINGW64 ~
$ ./AppData/Local/Programs/localstack-cockpit/resources/vendor/win32/localstack-packaged-cli/localstack.exe start
Traceback (most recent call last):
  File "main.py", line 6, in <module>
  File "localstack\cli\main.py", line 6, in main
  File "localstack\cli\plugin.py", line 15, in __call__
  File "click\core.py", line 1128, in __call__
  File "click\core.py", line 1053, in main
  File "click\core.py", line 1659, in invoke
  File "click\core.py", line 1395, in invoke
  File "click\core.py", line 754, in invoke
  File "localstack\cli\localstack.py", line 122, in cmd_start
  File "localstack\cli\localstack.py", line 435, in print_version
  File "rich\console.py", line 1637, in print
  File "rich\console.py", line 837, in __exit__
  File "rich\console.py", line 795, in _exit_buffer
  File "rich\console.py", line 1927, in _check_buffer
  File "encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4bb' in position 1: character maps to <undefined>
*** You may need to add PYTHONIOENCODING=utf-8 to your environment ***
[13272] Failed to execute script 'main' due to unhandled exception!

     __                     _______ __             __
    / /   ____  _________ _/ / ___// /_____ ______/ /__
   / /   / __ \/ ___/ __ `/ /\__ \/ __/ __ `/ ___/ //_/
  / /___/ /_/ / /__/ /_/ / /___/ / /_/ /_/ / /__/ ,<
 /_____/\____/\___/\__,_/_//____/\__/\__,_/\___/_/|_|

some observations:

thomas@DESKTOP-HDNUHFQ MINGW64 ~
$ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_ALL=en_US.utf8
主要语言
Makefile
星标
27
派生
9
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

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

相似的 Issue

更多 CLI Issue

把新 issue 发到你的邮箱

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