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/loader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'backend/loader.py') diff --git a/backend/loader.py b/backend/loader.py index 2eeead36..48a66a8d 100644 --- a/backend/loader.py +++ b/backend/loader.py @@ -118,7 +118,7 @@ class Loader: def handle_frontend_bundle(self, request): plugin = self.plugins[request.match_info["plugin_name"]] - with open(path.join(self.plugin_path, plugin.plugin_directory, "dist/index.js"), 'r') as bundle: + with open(path.join(self.plugin_path, plugin.plugin_directory, "dist/index.js"), "r", encoding="utf-8") as bundle: return web.Response(text=bundle.read(), content_type="application/javascript") def import_plugin(self, file, plugin_directory, refresh=False, batch=False): @@ -186,7 +186,7 @@ class Loader: """ async def load_plugin_main_view(self, request): plugin = self.plugins[request.match_info["name"]] - with open(path.join(self.plugin_path, plugin.plugin_directory, plugin.main_view_html), 'r') as template: + with open(path.join(self.plugin_path, plugin.plugin_directory, plugin.main_view_html), "r", encoding="utf-8") as template: template_data = template.read() ret = f""" @@ -202,7 +202,7 @@ class Loader: self.logger.info(path) ret = "" file_path = path.join(self.plugin_path, plugin.plugin_directory, route_path) - with open(file_path, 'r') as resource_data: + with open(file_path, "r", encoding="utf-8") as resource_data: ret = resource_data.read() return web.Response(text=ret) -- cgit v1.2.3