Projet

Général

Profil

Bug #23055

erreur de décodage lors du formatage d'une chaîne traduite dans PickerWidgetMixin

Ajouté par Benjamin Dauvergne il y a environ 6 ans. Mis à jour il y a plus de 5 ans.

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

100%

Temps estimé:
Patch proposed:
Non
Planning:

Description

Les chaînes traduires produisent des objets proxy qui décide d'être des str ou des unicode selon la méthode appelée, si on formate via une chaîne d'octets au lieu d'une chaîne unicode, on obtiendra de l'encodage UTF-8 systématiquement, la règle serait de toujours formatter les chaînes traduites en unicode.

Révisions associées

Révision 33ffd4e4 (diff)
Ajouté par Benjamin Dauvergne il y a environ 6 ans

fix UnicodeDecodeError in PickerWidgetMixin (fixes #23055)

'%s' % _(whatever) will produce a str containing utf-8 characters, but
it will fail when interpolated with another unicode string, which
happend in:

'%s %s' % (_('Format:'), self.options['format'])

as self.options['format'] is unicode.

Historique

#1

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

  • Statut changé de Nouveau à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#2

Mis à jour par Benjamin Dauvergne il y a plus de 5 ans

  • Statut changé de Résolu (à déployer) à Fermé

Formats disponibles : Atom PDF