Projet

Général

Profil

Bug #40830

python3: convertir .values en liste

Ajouté par Nicolas Roche il y a environ 4 ans. Mis à jour il y a environ 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
19 mars 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Bug lors de l'accès aux settings :

>       authentic_site = settings.KNOWN_SERVICES.get('authentic').values()[0]
E       TypeError: 'dict_values' object is not subscriptable

Parce que python3 retourne un dict_values et non plus une liste :

(Pdb) settings.KNOWN_SERVICES.get('authentic').values()
dict_values([{'url': 'http://authentic.example.net/', 'orig': 'http://welco.example.net/', 'secret': 'xxx'}])

C'était le propos de https://git.entrouvert.org/welco.git/commit/?id=a78e56758398896d812ca1812dc837bb28b711cb ,
(issu de #39092) là où les tests permettaient de le détecter. (#40816 couvrira ce code)


Fichiers

Révisions associées

Révision 6ee12857 (diff)
Ajouté par Nicolas Roche il y a environ 4 ans

python3: convert .values to list before accessing (#40830)

Historique

#1

Mis à jour par Nicolas Roche il y a environ 4 ans

  • Fichier 0001-python3-convert-.values-to-list-before-accessing-408.patch ajouté
  • Statut changé de Nouveau à Solution proposée
  • Patch proposed changé de Non à Oui
#2

Mis à jour par Nicolas Roche il y a environ 4 ans

(j'ai supprimé un saut à la ligne dans le patch précédent)

#3

Mis à jour par Nicolas Roche il y a environ 4 ans

  • Fichier 0001-python3-convert-.values-to-list-before-accessing-408.patch supprimé
#4

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

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

Mis à jour par Nicolas Roche il y a environ 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 6ee128570184eeb27f19ba015a2d700a417b8c78
Author: Nicolas ROCHE <nroche@entrouvert.com>
Date:   Thu Mar 19 12:03:37 2020 +0100

    python3: convert .values to list before accessing (#40830)
#6

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