Projet

Général

Profil

Bug #52694

génération du form_details dans un odt : le contenu de définition de style n'est plus remplacé

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

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

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Vraisemblalement par une mise à jour python / ElementTree, qui a emmené le retrait de getchilren, la forme alternative ne fonctionne pas :

-                    for child in node.getchildren():
+                    for child in node:
                         node.remove(child)

(bout de 7b09c482222e087b2687bb34adf2366392a8ce98 qui n'a pas de référence redmine)


Fichiers

y.pdf (14,8 ko) y.pdf tout le monde a trouvé normal ce fichier Frédéric Péters, 03 avril 2021 17:35
0001-workflows-fix-removal-of-existing-form_details-odt-s.patch (2,31 ko) 0001-workflows-fix-removal-of-existing-form_details-odt-s.patch Frédéric Péters, 03 avril 2021 17:51

Révisions associées

Révision 17b13502 (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

workflows: fix removal of existing form_details odt section (#52694)

Historique

#1

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

#2

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

Il y a une note à ce sujet dans la documentation :

Note that concurrent modification while iterating can lead to problems, just like when iterating and modifying Python lists or dicts. Therefore, the example first collects all matching elements with root.findall(), and only then iterates over the list of matches.
https://docs.python.org/3/library/xml.etree.elementtree.html

"can lead to problems" c'était genre un élément sur deux retiré, et le test qui existait pour bien vérifier que la section était vidée, il s'assurait juste que le premier ait bien disparu, pas de chance.

#3

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

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

Ok. Mais pourquoi pas list(node) ?

#4

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

  • Statut changé de Solution validée à Résolu (à déployer)
commit 17b135023dde82bbcfec02ff8f77258a1171ba80
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Sat Apr 3 17:48:47 2021 +0200

    workflows: fix removal of existing form_details odt section (#52694)
#5

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

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

Formats disponibles : Atom PDF