addok icon indicating copy to clipboard operation
addok copied to clipboard

Géocodage CSV: erreur si nom de fichier avec accents et/ou espaces

Open cquest opened this issue 6 years ago • 4 comments

Constaté sur un fichier dont le contenu est encodé en iso-8859-1. Une fois le fichier renommé, il est correctement géocodé.

cquest avatar Sep 25 '17 10:09 cquest

Je reproduis pas, tu peux m'envoyer le fichier en question?

yohanboniface avatar Sep 26 '17 09:09 yohanboniface

Constaté sur un fichier dont le contenu est encodé en iso-8859-1

Ah, raté ça, je retente un coup

yohanboniface avatar Sep 26 '17 09:09 yohanboniface

humm, on dirait que j'ai plus accès au serveur addok pour aller regarder les logs, la config, etc.

Et je veux bien le fichier aussi steup.

yohanboniface avatar Sep 26 '17 10:09 yohanboniface

voici le log que j'ai sur ma plate-forme avec l'envoi d'un fichier en ISO-8859-1 et aussitôt la même requête avec le fichier converti avec iconv en utf8 : Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/falcon/api.py", line 227, in call responder(req, resp, **params) File "/usr/local/lib/python3.4/dist-packages/addok_csv/init.py", line 123, in on_post content = self.compute_content(req, file_, encoding) File "/usr/local/lib/python3.4/dist-packages/addok_csv/init.py", line 37, in compute_content content = file_.file.read().decode(encoding) File "/usr/lib/python3.4/encodings/utf_8_sig.py", line 23, in decode (output, consumed) = codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 2335: invalid continuation byte [pid: 32600|app: 0|req: 272/491] 10.227.152.147 () {40 vars in 626 bytes} [Wed Sep 27 14:08:29 2017] POST /search/csv/ => generated 0 b ytes in 3 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0) [pid: 32600|app: 0|req: 273/492] 10.227.152.147 () {40 vars in 626 bytes} [Wed Sep 27 14:11:21 2017] POST /search/csv/ => generated 523 42 bytes in 4259 msecs (HTTP/1.1 200) 5 headers in 257 bytes (1 switches on core 0) [pid: 32600|app: 0|req: 274/493] 10.192.56.128 () {46 vars in 743 bytes} [Wed Sep 27 14:25:27 2017] POST /search/csv => generated 119 b ytes in 1 msecs (HTTP/1.1 400) 5 headers in 189 bytes (1 switches on core 0)

Niarolf avatar Sep 27 '17 12:09 Niarolf