Uppercase "UTF-8" encoding name no longer works in CircuitPython 11
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- embedded-iot
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C
- Stelle
- 4.6k
- Fork
- 1.4k
- Merge medio
- 23h 40m
- PR unite (30g)
- 167
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di adafruit/circuitpython
-
zephyr: REPL on console?Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
adafruit/circuitpython#11606 ·
I maintainer di solito rispondono entro 1 giorno
-
busio zephyr
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
adafruit/circuitpython#11605 ·
I maintainer di solito rispondono entro 1 giorno
-
busio zephyr
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
adafruit/circuitpython#11604 ·
I maintainer di solito rispondono entro 1 giorno
-
busio zephyr
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
adafruit/circuitpython#11603 ·
I maintainer di solito rispondono entro 1 giorno
-
busio zephyr
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
adafruit/circuitpython#11602 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di adafruit/circuitpython
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
test/command failure with filtered `listxattr` syscallForse già presa @Kiskae l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100