From 612c3605b50e3aee5ad39c361f68b4c34e5486df Mon Sep 17 00:00:00 2001 From: graynk Date: Mon, 24 Apr 2017 22:12:00 +0500 Subject: [PATCH 1/2] fix for non-latin symbols in GPM module --- bumblebee/modules/gpmdp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/gpmdp.py b/bumblebee/modules/gpmdp.py index 36988e8..1bef52c 100644 --- a/bumblebee/modules/gpmdp.py +++ b/bumblebee/modules/gpmdp.py @@ -52,7 +52,7 @@ class Module(bumblebee.engine.Module): status = bumblebee.util.execute("gpmdp-remote status") except RuntimeError: pass - self._status = status.split("\n")[0].lower() - self._tags = info.split("\n")[0] + self._status = status.decode('utf-8').split("\n")[0].lower() + self._tags = info.decode('utf-8').split("\n")[0] # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 From 0dfa80fc7a81f09ab83d1fcee789deb0721103f3 Mon Sep 17 00:00:00 2001 From: graynk Date: Mon, 24 Apr 2017 23:18:15 +0500 Subject: [PATCH 2/2] fix should work for Python 2 and 3 --- bumblebee/modules/gpmdp.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/gpmdp.py b/bumblebee/modules/gpmdp.py index 1bef52c..ef74fbe 100644 --- a/bumblebee/modules/gpmdp.py +++ b/bumblebee/modules/gpmdp.py @@ -52,7 +52,13 @@ class Module(bumblebee.engine.Module): status = bumblebee.util.execute("gpmdp-remote status") except RuntimeError: pass - self._status = status.decode('utf-8').split("\n")[0].lower() - self._tags = info.decode('utf-8').split("\n")[0] + try: + unicode_status = status.decode('utf-8') + unicode_info = info.decode('utf-8') + except AttributeError: + unicode_status = status + unicode_info = info + self._status = unicode_status.split("\n")[0].lower() + self._tags = unicode_info.split("\n")[0] # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4