Project

General

Profile

Bug #25984

crash sur import CSV "events" avec des accents

Added by Thomas Noël 8 months ago. Updated 20 days ago.

Status:
Solution déployée
Priority:
Normal
Assignee:
-
Category:
-
Start date:
31 Aug 2018
Due date:
% Done:

0%

Patch proposed:
Yes
Planning:
No

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.

0001-manager-allow-CSV-file-to-be-iso-8859-15-25984.patch View (3.5 KB) Frédéric Péters, 25 Mar 2019 06:17 PM

Associated revisions

Revision cdb90482 (diff)
Added by Frédéric Péters 20 days ago

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

History

#2 Updated by Thomas Noël 8 months ago

  • Subject changed from crash sur import ICS avec des accents to crash sur import CSV "events" avec des accents

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

#3 Updated by Frédéric Péters 29 days ago

#4 Updated by Emmanuel Cazenave 20 days ago

  • Status changed from Solution proposée to Solution validée

#5 Updated by Frédéric Péters 20 days ago

  • Status changed from Solution validée to 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 Updated by Frédéric Péters 20 days ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF