From 64596bc166165573d7ae6cd60e466f400e88dd07 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 26 May 2020 03:17:51 +0200 Subject: [PATCH] Get rid of unicode warning --- src/yunohost/diagnosis.py | 2 +- src/yunohost/service.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yunohost/diagnosis.py b/src/yunohost/diagnosis.py index 035e1a889..76c4d1243 100644 --- a/src/yunohost/diagnosis.py +++ b/src/yunohost/diagnosis.py @@ -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): diff --git a/src/yunohost/service.py b/src/yunohost/service.py index fd65cbc0c..faaf70cdc 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -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 = {