]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
fix addons load in python2
authorDjLegolas <redacted>
Sat, 7 May 2022 16:16:11 +0000 (19:16 +0300)
committerPatrick <redacted>
Sat, 7 May 2022 16:34:47 +0000 (11:34 -0500)
plugins/python/python.py

index 0420a4e216547af02ee761ce1c5a4ad7e27c9455..7a7947841684d4a25abde018b5283fb53c38c27e 100644 (file)
@@ -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)