Open module files explicitly as utf8 in ModuleManager

This commit is contained in:
jesopo 2018-09-27 12:35:09 +01:00
parent 6c63655a6e
commit 5674dc4a82

View file

@ -1,4 +1,4 @@
import glob, imp, inspect, os, sys, uuid import glob, imp, io, inspect, os, sys, uuid
BITBOT_HOOKS_MAGIC = "__bitbot_hooks" BITBOT_HOOKS_MAGIC = "__bitbot_hooks"
BITBOT_EXPORTS_MAGIC = "__bitbot_exports" BITBOT_EXPORTS_MAGIC = "__bitbot_exports"
@ -50,7 +50,7 @@ class ModuleManager(object):
def _load_module(self, name): def _load_module(self, name):
path = self._module_path(name) path = self._module_path(name)
with open(path) as module_file: with io.open(path, mode="r", encoding="utf8") as module_file:
while True: while True:
line = module_file.readline().strip() line = module_file.readline().strip()
line_split = line.split(" ") line_split = line.split(" ")