From 0474095a40ba6cb729064654d22efd88f91958d6 Mon Sep 17 00:00:00 2001 From: Nik Date: Fri, 16 Dec 2022 15:23:04 +0100 Subject: Potentially fix locale issues (#284) --- backend/updater.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backend/updater.py') diff --git a/backend/updater.py b/backend/updater.py index 301ca396..15a93e8a 100644 --- a/backend/updater.py +++ b/backend/updater.py @@ -32,7 +32,7 @@ class Updater: self.allRemoteVers = None try: logger.info(getcwd()) - with open(path.join(getcwd(), ".loader.version"), 'r') as version_file: + with open(path.join(getcwd(), ".loader.version"), "r", encoding="utf-8") as version_file: self.localVer = version_file.readline().replace("\n", "") except: self.localVer = False @@ -159,10 +159,10 @@ class Updater: out.write(data) except Exception as e: logger.error(f"Error at %s", exc_info=e) - with open(path.join(getcwd(), "plugin_loader.service"), 'r') as service_file: + with open(path.join(getcwd(), "plugin_loader.service"), "r", encoding="utf-8") as service_file: service_data = service_file.read() service_data = service_data.replace("${HOMEBREW_FOLDER}", "/home/"+helpers.get_user()+"/homebrew") - with open(path.join(getcwd(), "plugin_loader.service"), 'w') as service_file: + with open(path.join(getcwd(), "plugin_loader.service"), "w", encoding="utf-8") as service_file: service_file.write(service_data) logger.debug("Saved service file") @@ -191,7 +191,7 @@ class Updater: self.context.loop.create_task(tab.evaluate_js(f"window.DeckyUpdater.updateProgress({new_progress})", False, False, False)) progress = new_progress - with open(path.join(getcwd(), ".loader.version"), "w") as out: + with open(path.join(getcwd(), ".loader.version"), "w", encoding="utf-8") as out: out.write(version) call(['chmod', '+x', path.join(getcwd(), "PluginLoader")]) -- cgit v1.2.3