Possible encoding problem with Repository.file_status
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 1.7k
- Fork
- 408
- Merge medio
- 2g 57m
- PR unite (30g)
- 7
Descrizione
If I try to get the status of a single file using Repository.file_status, I get a "KeyError" when the path contains non-ASCII characters like "ä" or "\u00A0" (non breaking space").
The problem seems to be that "Repository_status_file" uses "py_path_to_c_str" to convert the path. Which encodes the path using the Python file system encoding.
If I encode the string myself using "utf-8", it works fine.
Not sure whether this is a libgit2, pygit2 or Windows problem...
Using pygit-0.24.2 on Python 3.5, running on Windows 7.
sys.getfilesystemencoding() returns "mbcs".
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 riproducendo il caso Windows con Python 3.5 usando Repository.file_status per percorsi contenenti ä e uno spazio non divisibile. Traccia il percorso attraverso Repository_status_file e py_path_to_c_str, confrontando gli input codificati per il filesystem e gli input UTF-8; il lavoro è completato quando il percorso non ASCII non solleva più KeyError.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- git, python
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100