Projet

Général

Profil

Bug #9980

backoffice : trace sur format de date invalide utilisé dans les stats

Ajouté par Frédéric Péters il y a environ 8 ans. Mis à jour il y a 10 mois.

Statut:
Fermé
Priorité:
Bas
Assigné à:
-
Version cible:
-
Début:
15 février 2016
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Exception:
  type = '<type 'exceptions.ValueError'>', value = 'time data '31122016' does not match format '%d/%m/%Y''

Stack trace (most recent call first):
  File "/usr/lib/python2.7/_strptime.py", line 325, in _strptime
   323     if not found:
   324         raise ValueError("time data %r does not match format %r" %
>  325                          (data_string, format))
   326     if len(data_string) != found.end():
   327         raise ValueError("unconverted data remains: %s" %

  locals:
     found = None
     format = '%d/%m/%Y'
     data_string = '31122016'
     format_regex = <_sre.SRE_Pattern object at 0x4326c30>
     locale_time = <_strptime.LocaleTime object at 0x43956d0>

  File "/usr/lib/python2.7/_strptime.py", line 467, in _strptime_time
   465
   466 def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
>  467     return _strptime(data_string, format)[0]

  locals:
     data_string = '31122016'
     format = '%d/%m/%Y'

  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/management.py", line 1026, in get_criterias_from_query
  1024                 criterias[-1]._label = '%s: %s' % (_('Start'), filter_field_value)
  1025             elif filter_field.id == 'end':
> 1026                 period_end = time.strptime(filter_field_value, format_string)
  1027                 criterias.append(LessOrEqual('receipt_time', period_end))
  1028                 criterias[-1]._label = '%s: %s' % (_('End'), filter_field_value)

  locals:
     criterias = [<qommon.storage.GreaterOrEqual object at 0x4b47950>]
     format_string = '%d/%m/%Y'
     filter_field = <wcs.backoffice.management.FakeField object at 0x503fb90>
     period_fake_fields = [<wcs.backoffice.management.FakeField object at 0x503f1d0>, <wcs.backoffice.management.FakeField object at 0x503fb90>]
     filter_field_key = 'filter-end-value'
     filter_fields = []
     period_start = time.struct_time(tm_year=2016, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=4, tm_yday=1, tm_isdst=-1)
     filter_field_value = '31122016'
     self = <wcs.backoffice.management.FormPage object at 0x7fc024ffae90>

  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/management.py", line 1374, in stats
  1372
  1373         selected_filter = self.get_filter_from_query(default='all')
> 1374         criterias = self.get_criterias_from_query()
  1375         get_response().filter['sidebar'] = self.get_formdata_sidebar() + \
  1376                 self.get_stats_sidebar(selected_filter)

  locals:
     r = <TemplateIO object at 0x57e4830>
     selected_filter = 'all'
     self = <wcs.backoffice.management.FormPage object at 0x7fc024ffae90>
</pr>

Demandes liées

Lié à w.c.s. - Bug #11227: ValueError: time data '04/2016' does not match format '%d/%m/%Y'Rejeté06 juin 2016

Actions

Historique

#1

Mis à jour par Frédéric Péters il y a presque 8 ans

  • Lié à Bug #11227: ValueError: time data '04/2016' does not match format '%d/%m/%Y' ajouté
#2

Mis à jour par Frédéric Péters il y a 10 mois

  • Statut changé de Nouveau à Fermé
  • Planning mis à Non

Ça ne crashe plus, ça affiche "date invalide" à côté du critère concerné (sans doute corrigé via #15204).

Formats disponibles : Atom PDF