Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Uppercase "UTF-8" encoding name no longer works in CircuitPython 11

Chiusa
#11,580 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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
Stack tecnologico
c, python
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

bug cpython api

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di adafruit/circuitpython

Tutte le issue di adafruit/circuitpython

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.