From a85a032e09f499c14b3740d3bd02f6a1f20e038a Mon Sep 17 00:00:00 2001 From: Etoh Date: Tue, 21 Feb 2023 20:06:04 +0000 Subject: [PATCH] Log --debug as UTF-8 to fix charmap mapping (v2) --- syncplay/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncplay/utils.py b/syncplay/utils.py index 41e597a..5f42a39 100755 --- a/syncplay/utils.py +++ b/syncplay/utils.py @@ -195,13 +195,13 @@ def blackholeStdoutForFrozenWindow(): _file = None _error = None - def write(self, text, fname='.syncplay.log', encoding='utf-8'): + def write(self, text, fname='.syncplay.log'): if self._file is None and self._error is None: if os.name != 'nt': path = os.path.join(os.getenv('HOME', '.'), fname) else: path = os.path.join(os.getenv('APPDATA', '.'), fname) - self._file = open(path, 'a') + self._file = open(path, 'a', encoding='utf-8') # TODO: Handle errors. if self._file is not None: self._file.write(text)