1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix UnicodeError loading plugins with non-ascii in them on python3

This commit is contained in:
Toshio Kuratomi 2016-09-06 16:35:25 -07:00
parent 113dfc5562
commit 1d412059a0

View file

@ -317,7 +317,7 @@ class PluginLoader:
return sys.modules[name] return sys.modules[name]
with warnings.catch_warnings(): with warnings.catch_warnings():
warnings.simplefilter("ignore", RuntimeWarning) warnings.simplefilter("ignore", RuntimeWarning)
with open(path, 'r') as module_file: with open(path, 'rb') as module_file:
module = imp.load_source(name, path, module_file) module = imp.load_source(name, path, module_file)
return module return module