Bug #30890
logging journald vs unicode
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Catégorie:
-
Version cible:
-
Début:
25 février 2019
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Description
Logged from file requests_wrapper.py, line 69 Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/hobo/journal.py", line 200, in emit **extras) File "/usr/lib/python2.7/dist-packages/hobo/journal.py", line 89, in send args.extend(_make_line(key, val) for key, val in kwargs.items()) File "/usr/lib/python2.7/dist-packages/hobo/journal.py", line 89, in <genexpr> args.extend(_make_line(key, val) for key, val in kwargs.items()) File "/usr/lib/python2.7/dist-packages/hobo/journal.py", line 42, in _make_line return field + '=' + str(value) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)
(trouvé dans un daemon.log, process uwsgi à l'origine)
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a environ 5 ans
- Fichier 0001-misc-allow-journald-logging-of-unicode-strings-30890.patch 0001-misc-allow-journald-logging-of-unicode-strings-30890.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Si jamais c'est unicode, ça fera une chaine globalement unicode et ça sera envoyé et géré correctement dans l'appel sendv, qui gère l'encodage,
if (PyUnicode_Check(item)) { encoded[i] = PyUnicode_AsEncodedString(item, "utf-8", "strict"); if (encoded[i] == NULL) goto out; item = encoded[i]; }
Mis à jour par Christophe Siraut il y a environ 5 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Frédéric Péters il y a environ 5 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 5264b1c6e036cc667dccabd17e2e0abff3bec763 Author: Frédéric Péters <fpeters@entrouvert.com> Date: Mon Feb 25 21:41:11 2019 +0100 misc: allow journald logging of unicode strings (#30890)
Mis à jour par Frédéric Péters il y a environ 5 ans
- Statut changé de Résolu (à déployer) à Solution déployée
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
basestring
n'existe pas en python3, pas très grave pour l'instant.
misc: allow journald logging of unicode strings (#30890)