Development #53323
sur l'import csv d'un fichier invalide, trace "Error: line contains NULL byte"
Début:
21 avril 2021
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
https://sentry.entrouvert.org/entrouvert/publik/issues/43700/
Error: line contains NULL byte (13 additional frame(s) were not displayed) ... File "django/forms/forms.py", line 412, in _clean_form cleaned_data = self.clean() File "authentic2/manager/forms.py", line 721, in clean if not importer.run(import_file, encoding): File "authentic2/csv_import.py", line 183, in run return parse_csv(final_input_fd) File "authentic2/csv_import.py", line 176, in parse_csv self.rows = list(reader) File "authentic2/csv_import.py", line 95, in __next__ row = self.reader.__next__()
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a environ 3 ans
- Projet changé de Suivi des traces à Authentic 2
Mis à jour par Valentin Deniaud il y a presque 3 ans
- Fichier 0001-csv_import-handle-null-bytes-53323.patch 0001-csv_import-handle-null-bytes-53323.patch ajouté
- Tracker changé de Bug à Development
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Thomas Noël il y a presque 3 ans
Pour avoir un message un peu compréhensible qui s'affiche un peu en français (et pas juste l'exception), on pourrait faire quelque chose comme ce qui suit :
self.error = Error('csv-read-error', _('Cannot read CSV: %s') % e)
Mis à jour par Valentin Deniaud il y a presque 3 ans
- Fichier 0001-csv_import-handle-null-bytes-53323.patch 0001-csv_import-handle-null-bytes-53323.patch ajouté
Yep bonne idée
Mis à jour par Thomas Noël il y a presque 3 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Valentin Deniaud il y a presque 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit adf8bf659b10f34932ee1dceeea75b7550385990 Author: Valentin Deniaud <vdeniaud@entrouvert.com> Date: Thu Apr 29 11:13:59 2021 +0200 csv_import: handle null bytes (#53323)
Mis à jour par Frédéric Péters il y a presque 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
csv_import: handle null bytes (#53323)