Signature email requires ASCII on Python 2 but requires Unicode only "str" on Python 3
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 1.7k
- Fork
- 408
- Merge medio
- 2g 57m
- PR unite (30g)
- 7
Descrizione
Signature_init in signature.c currently uses the s format string for parsing the email argument. This is inconsistent between Python 2 and 3. On Python 2, it accepts either text (unicode) or bytes (str) and implicitly encodes text using the default system encoding, which is ascii by default (and it seems like changing it is kind of weird and not really recommended by most people). Python 3, it only accepts text (str), and it's implicitly encodes it using UTF-8.
The name argument for Signature_init just uses O and accepts either text or bytes. It appears to implicitly encode text using UTF-8 and leaves bytes as-is. I would expect the email argument to work the same way.
So there's currently no way to pass in bytes on Python 3 and no way to pass in non-ASCII text on Python 2.
Guida per i contributori
Apri la guida per i contributori
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.
Direzione di ricerca
Inizia in signature.c, in Signature_init, e verifica come viene analizzato l’argomento email rispetto all’argomento name. Verifica il comportamento con Python 2 e Python 3; il lavoro è completato quando email accetta bytes in Python 3 e testo non ASCII in Python 2 in modo coerente con name.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, python
- Ambito
- api
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 48/100