From 16acca16b9ff0ad5ed3861d7562b12e6562e4ca8 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 26 Feb 2017 16:01:35 +0100 Subject: [PATCH] Fix UnicodeDecodeError for non-ASCII filenames - Fixes #229 --- resources/lib/playlist_func.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/playlist_func.py b/resources/lib/playlist_func.py index 1485d9b5..6714c900 100644 --- a/resources/lib/playlist_func.py +++ b/resources/lib/playlist_func.py @@ -3,7 +3,7 @@ from urllib import quote import plexdb_functions as plexdb from downloadutils import DownloadUtils as DU -from utils import JSONRPC, tryEncode +from utils import JSONRPC, tryEncode, tryDecode from PlexAPI import API ############################################################################### @@ -36,7 +36,7 @@ class Playlist_Object_Baseclase(object): answ += "items: %s, " % self.items for key in self.__dict__: if key not in ("ID", 'items'): - answ += '%s: %s, ' % (key, getattr(self, key)) + answ += '%s: %s, ' % (key, tryDecode(str(getattr(self, key)))) return answ[:-2] + ">" def clear(self): @@ -80,7 +80,7 @@ class Playlist_Item(object): def __repr__(self): answ = "<%s: " % (self.__class__.__name__) for key in self.__dict__: - answ += '%s: %s, ' % (key, getattr(self, key)) + answ += '%s: %s, ' % (key, tryDecode(str(getattr(self, key)))) return answ[:-2] + ">"