Projet

Général

Profil

Bug #24670

crash sur validation d'un widget ComputedExpressionWidget vide alors qu'en mode Python

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

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
20 juin 2018
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

Exception:
  type = '<type 'exceptions.TypeError'>', value = 'cannot concatenate 'str' and 'NoneType' objects'

Stack trace (most recent call first):
  File "/usr/lib/python2.7/dist-packages/wcs/qommon/form.py", line 2331, in _parse
  2329         value_content = self.get('value_%s' % value_type)
  2330         if value_type == 'python':
> 2331             self.value = '=' + value_content
  2332         else:
  2333             self.value = value_content

  locals:
     request = <wcs.compat.CompatHTTPRequest instance at 0x7f8b73ce47a0>
     self = <ComputedExpressionWidget at 7f8b73bb4e50: fields$element4$value>
     value_content = None
     value_type = 'python'

  File "/usr/lib/pymodules/python2.7/quixote/form/widget.py", line 127, in parse
   125                     self._parse(request)
   126                 except WidgetValueError, exc:
>  127                     self.set_error(stringify(exc))
   128                 if (self.required and self.value is None and
   129                     not self.has_error()):

  locals:
     request = <wcs.compat.CompatHTTPRequest instance at 0x7f8b73ce47a0>
     self = <ComputedExpressionWidget at 7f8b73bb4e50: fields$element4$value>

  File "/usr/lib/pymodules/python2.7/quixote/form/widget.py", line 733, in get
   731         widget = self._names.get(name)
   732         if widget:
>  733             return widget.parse()
   734         return None
   735

Fichiers

Révisions associées

Révision 486225c4 (diff)
Ajouté par Thomas Noël il y a presque 6 ans

correctly forbid empty Python expression (#24670)

Historique

#1

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

Au passage je corrige le test "=hello world" qui devait être "hello world", et j'ajoute un "=3" pour les gens qui penseraient qu'il faut encore mettre un = au début du Python (le test vérifie que ça va bien crier).

#2

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

Ack.

#3

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

  • Statut changé de En cours à Résolu (à déployer)
commit 486225c4b2c425ae782aa6a156d66a4b572e264b
Author: Thomas NOEL <tnoel@entrouvert.com>
Date:   Thu Jun 21 00:28:42 2018 +0200

    correctly forbid empty Python expression (#24670)

#4

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

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

Formats disponibles : Atom PDF