Projet

Général

Profil

Bug #25984

crash sur import CSV "events" avec des accents

Ajouté par Thomas Noël il y a plus de 5 ans. Mis à jour il y a environ 5 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Catégorie:
-
Version cible:
-
Début:
31 août 2018
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

Internal Server Error: /manage/agendas/41/import-events
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/chrono/manager/views.py", line 278, in dispatch
    return super(ManagedAgendaMixin, self).dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/edit.py", line 214, in post
    if form.is_valid():
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 184, in is_valid
    return self.is_bound and not self.errors
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 176, in errors
    self.full_clean()
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 392, in full_clean
    self._clean_fields()
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 410, in _clean_fields
    value = getattr(self, 'clean_%s' % name)()
  File "/usr/lib/python2.7/dist-packages/chrono/manager/forms.py", line 190, in clean_events_csv_file
    event.label = ' '.join([force_text(x) for x in csvline[4:]])
  File "/usr/lib/python2.7/dist-packages/django/utils/encoding.py", line 102, in force_text
    raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0xe8 in position 11: invalid continuation byte. You passed in 'Cycle I - 2\xe8me ann\xe9e - lundi 17h00/18h00 - L RABIER ' (<type 'str'>)

L'encodage n'est pas utf-8, faudrait parvenir à gérer cela, ou cracher proprement.


Fichiers

Révisions associées

Révision cdb90482 (diff)
Ajouté par Frédéric Péters il y a environ 5 ans

manager: allow CSV file to be iso-8859-15 (#25984)

Historique

#2

Mis à jour par Thomas Noël il y a plus de 5 ans

  • Sujet changé de crash sur import ICS avec des accents à crash sur import CSV "events" avec des accents

En fait c'est lors de l'import d'un csv, mal lu la trace.

#3

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

#4

Mis à jour par Emmanuel Cazenave il y a environ 5 ans

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

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

  • Statut changé de Solution validée à Résolu (à déployer)
commit cdb90482c3c38d81f03ca21aa2c9ca37bc57be0e
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Mon Mar 25 18:17:06 2019 +0100

    manager: allow CSV file to be iso-8859-15 (#25984)
#6

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

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF