From e63e74976ccd2133bebcecb8041e54ad84831d78 Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Sun, 11 Mar 2018 18:40:35 +0100 Subject: [PATCH] Fixes a crash in consoleUI when filename contains non-ASCII characters --- syncplay/ui/consoleUI.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syncplay/ui/consoleUI.py b/syncplay/ui/consoleUI.py index 332a0ca..3f7433d 100644 --- a/syncplay/ui/consoleUI.py +++ b/syncplay/ui/consoleUI.py @@ -91,6 +91,10 @@ class ConsoleUI(threading.Thread): def showMessage(self, message, noTimestamp=False): message = message.encode(sys.stdout.encoding, 'replace') + try: + message = message.decode('utf-8') + except UnicodeEncodeError: + pass if noTimestamp: print(message) else: