Projet

Général

Profil

Bug #39240

condition à moitié définie en xml

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

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
24 janvier 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

donne :

Exception:
  type = '<type 'exceptions.AttributeError'>', value = ''NoneType' object has no attribute 'encode''

Stack trace (most recent call first):
  File "/usr/lib/python2.7/dist-packages/wcs/qommon/__init__.py", line 40, in force_str
    38         if isinstance(s, str):
    39             return s
>   40         return s.encode('utf-8')
    41 else:
    42     force_str = force_text

  locals:
     s = None

  File "/usr/lib/python2.7/dist-packages/wcs/fields.py", line 308, in condition_init_with_xml
   306             self.condition = {
   307                 'type': force_str(node.find('type').text),
>  308                 'value': force_str(node.find('value').text),
   309             }
   310         elif node.text:

  locals:
     charset = 'utf-8'
     include_id = True
     node = <Element 'condition' at 0x7f4a4a8867d0>
     self = <TitleField None "Dotation d'objet publicitaire">

Fichiers

Révisions associées

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

misc: use helper function to get xml node text (#39240)

Historique

#1

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

  • Assigné à mis à Frédéric Péters
#2

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

Ajout d'un xml_node_text(node) qui gère la possibilité que node ou node.text soit None et utilisation semi-extensive de cette nouvelle fonction (en cherchant sur base de quelques patterns).

#3

Mis à jour par Benjamin Dauvergne il y a environ 4 ans

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

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

  • Statut changé de Solution validée à Résolu (à déployer)
commit 4f30c216af26bd84e8588204c9eb935c6a6de14e
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Fri Jan 24 14:25:43 2020 +0100

    misc: use helper function to get xml node text (#39240)
#5

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

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

Formats disponibles : Atom PDF