summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDjLegolas <djlegolas@protonmail.com>2022-05-07 19:16:11 +0300
committerPatrick <tingping@tingping.se>2022-05-07 11:34:47 -0500
commit6da8f97e37f1eb57c1dcb9fc094f386385dae22b (patch)
tree1509d9ef79258c3f8191e4d2fcc02432d407550e
parent2dd7636134f31d1f6f931f6adb0c33b3b5c12a34 (diff)
fix addons load in python2
-rw-r--r--plugins/python/python.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/python/python.py b/plugins/python/python.py
index 0420a4e2..7a794784 100644
--- a/plugins/python/python.py
+++ b/plugins/python/python.py
@@ -146,8 +146,8 @@ class Plugin:
     def loadfile(self, filename):
         try:
             self.filename = filename
-            with open(filename, encoding='utf-8') as f:
-                data = f.read()
+            with open(filename, 'rb') as f:
+                data = f.read().decode('utf-8')
             compiled = compile_file(data, filename)
             exec(compiled, self.globals)