Projet

Général

Profil

Bug #23021

import workflow et condition mal définie

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

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

0%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

Pas le fichier concerné à disposition mais :

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/wf/jump.py", line 130, in condition_init_with_xml
   128         else:
   129             # backward compatibility
>  130             self.condition = {'type': 'python', 'value': node.text.encode(charset)}
   131
   132     def migrate(self):

  locals:
     charset = 'utf-8'
     include_id = False
     node = <Element 'condition' at 0x7fe3a06438d0>
     self = <wcs.wf.jump.JumpWorkflowStatusItem object at 0x7fe397fa5dd0>

Fichiers

Révisions associées

Révision 7f30f312 (diff)
Ajouté par Frédéric Péters il y a environ 6 ans

misc: handle unexpected XML contents for conditions (#23021)

Historique

#1

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

#2

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

  • Sujet changé de import formulaire et condition mal définie à import workflow et condition mal définie
#4

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

Ok avec le strip() ajouté discrètement.

Ne sachant pas le XML en entrée je ne sais pas pourquoi on avait un None, imaginerait-on la même chose pour les node.find('value').text ? Et, dans ce cas, poser des « node.find('value').text.encode(charset) if node.find('value').text else '' » ?

#5

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

Je vais quand même attendre un peu voir si on nous communique l'xml en question mais a priori non je n'ajouterais pas la même chose pour les autres attributs.

#7

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

Fichiers XML fournis sur #23089, l'import passe avec le fix proposé.

Donc : ack.

#8

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

  • Statut changé de En cours à Résolu (à déployer)
commit 7f30f312c59e9cfed4b5fd70b7f50e9920caa8cb
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Fri Apr 6 19:48:05 2018 +0200

    misc: handle unexpected XML contents for conditions (#23021)

#9

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