Uppercase "UTF-8" encoding name no longer works in CircuitPython 11
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- embedded-iot
调研方向
The payload names no source files. Start from the encoding check that micropython/micropython#18854 and #19474 introduced, which accepts only utf-8, utf8 and ascii exactly, and reproduce with bytes("hi", "UTF-8") on a CircuitPython 11 build. The open question is whether the core should match names case-insensitively or the libraries should change, so settle that with the maintainers before writing a patch. Done means the chosen behaviour is agreed and "UTF-8" either encodes correctly or is documented as unsupported.
由索引模型根据 Issue 内容生成。
描述
Passing "UTF-8" as an encoding raises LookupError on CircuitPython 11.
It worked on 10.x and works in CPython.
>>> bytes("hi", "utf-8")
b'hi'
>>> bytes("hi", "UTF-8")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
LookupError: unknown encoding: UTF-8
>>> "hi".encode("UTF-8")
LookupError: unknown encoding: UTF-8
| Board | Version | "UTF-8" |
|---|---|---|
| Feather RP2040 RFM | 11.0.0-alpha.1 | LookupError |
| Fruit Jam | 11.0.0-alpha.1-71-g36a5653882 | LookupError |
| Metro RP2350 | 11.0.0-alpha.0-22-g4453bba9a1 | LookupError |
| (10.3.x source) | no encoding check |
The check came from micropython/micropython#18854 and micropython/micropython#19474, which accept only utf-8, utf8 and ascii exactly.
It breaks 9 of the 14 examples in adafruit/Adafruit_CircuitPython_RFM#26, and code search finds about 340 adafruit Python files using "UTF-8").
Should CircuitPython match encoding names case-insensitively, or should we fix the libraries?
Found with help from Claude Code. The REPL output is from the boards above.
- 主要语言
- C
- 星标
- 4.6k
- 派生
- 1.4k
- 平均合并
- 23 小时 40 分钟
- 30 天内合并 PR
- 167
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
adafruit/circuitpython 的其他 Issue
-
难度 5/5 一周以上 新手友好度 15/100
adafruit/circuitpython#11606 ·
维护者通常 1 天内回复
-
busio zephyr
难度 5/5 一周以上 新手友好度 18/100
adafruit/circuitpython#11605 ·
维护者通常 1 天内回复
-
busio zephyr
难度 4/5 3-5 天 新手友好度 28/100
adafruit/circuitpython#11604 ·
维护者通常 1 天内回复
-
busio zephyr
难度 4/5 3-5 天 新手友好度 22/100
adafruit/circuitpython#11603 ·
维护者通常 1 天内回复
-
busio zephyr
难度 5/5 一周以上 新手友好度 15/100
adafruit/circuitpython#11602 ·
维护者通常 1 天内回复
查看 adafruit/circuitpython 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
fluent/fluent-bit#12579 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
obsproject/obs-studio#14036 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
Feature Request
难度 2/5 1-3 小时 新手友好度 70/100
sandboxie-plus/Sandboxie#5653 ·
维护者通常 1 天内回复