From 6da8f97e37f1eb57c1dcb9fc094f386385dae22b Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Sat, 7 May 2022 19:16:11 +0300 Subject: fix addons load in python2 --- plugins/python/python.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/python/python.py') 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) -- cgit 1.4.1