From 7f083272c09d0d87ef9dbc8ffb6521849a3bb19a Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sat, 6 May 2017 08:48:02 +0200 Subject: [PATCH] Fix UnicodeDecodeError on user switch --- service.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/service.py b/service.py index 5d50fdad..176607dd 100644 --- a/service.py +++ b/service.py @@ -30,7 +30,7 @@ sys_path.append(_base_resource) ############################################################################### -from utils import settings, window, language as lang, dialog, tryDecode +from utils import settings, window, language as lang, dialog, tryEncode from userclient import UserClient import initialsetup from kodimonitor import KodiMonitor @@ -164,11 +164,12 @@ class Service(): counter = 0 while not monitor.abortRequested(): - if window('plex_kodiProfile') != kodiProfile: + if tryEncode(window('plex_kodiProfile')) != kodiProfile: # Profile change happened, terminate this thread and others log.warn("Kodi profile was: %s and changed to: %s. " "Terminating old PlexKodiConnect thread." - % (kodiProfile, window('plex_kodiProfile'))) + % (kodiProfile, + tryEncode(window('plex_kodiProfile')))) break # Before proceeding, need to make sure: