summaryrefslogtreecommitdiff
path: root/backend/loader.py
diff options
context:
space:
mode:
authorNik <werwolv98@gmail.com>2022-12-16 15:23:04 +0100
committerGitHub <noreply@github.com>2022-12-16 06:23:04 -0800
commit0474095a40ba6cb729064654d22efd88f91958d6 (patch)
tree12f26a43c6f16477bdac1b24a7991599662138e1 /backend/loader.py
parent346f80beb31d1e2a95d31a5997b5a233d08e0645 (diff)
downloaddecky-loader-0474095a40ba6cb729064654d22efd88f91958d6.tar.gz
decky-loader-0474095a40ba6cb729064654d22efd88f91958d6.zip
Potentially fix locale issues (#284)v2.4.6-pre5
Diffstat (limited to 'backend/loader.py')
-rw-r--r--backend/loader.py6
1 files changed, 3 insertions, 3 deletions
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"""
<script src="/legacy/library.js"></script>
@@ -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)