Get rid of unicode warning

This commit is contained in:
Alexandre Aubin 2020-05-26 03:17:51 +02:00
parent a23f02dbab
commit 64596bc166
2 changed files with 2 additions and 2 deletions

View file

@ -452,7 +452,7 @@ class Diagnoser():
key = "diagnosis_description_" + id_
descr = m18n.n(key)
# If no description available, fallback to id
return descr if descr != key else id_
return descr if descr.decode('utf-8') != key else id_
@staticmethod
def i18n(report, force_remove_html_tags=False):

View file

@ -354,7 +354,7 @@ def _get_and_format_service_status(service, infos):
# that mean that we don't have a translation for this string
# that's the only way to test for that for now
# if we don't have it, uses the one provided by systemd
if description == translation_key:
if description.decode('utf-8') == translation_key:
description = str(raw_status.get("Description", ""))
output = {