Projet

Général

Profil

Development #53323

sur l'import csv d'un fichier invalide, trace "Error: line contains NULL byte"

Ajouté par Sentry Io il y a environ 3 ans. Mis à jour il y a presque 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
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

Révision adf8bf65 (diff)
Ajouté par Valentin Deniaud il y a presque 3 ans

csv_import: handle null bytes (#53323)

Historique

#1

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Projet changé de Suivi des traces à Authentic 2
#2

Mis à jour par Valentin Deniaud il y a presque 3 ans

  • Assigné à mis à Valentin Deniaud
#3

Mis à jour par Valentin Deniaud il y a presque 3 ans

#4

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)
#6

Mis à jour par Thomas Noël il y a presque 3 ans

  • Statut changé de Solution proposée à Solution validée
#7

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)
#8

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

Formats disponibles : Atom PDF