summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/loader.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/plugins/loader.py')
-rw-r--r--lib/ansible/plugins/loader.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py
index fad424d31c..4e45e98076 100644
--- a/lib/ansible/plugins/loader.py
+++ b/lib/ansible/plugins/loader.py
@@ -352,7 +352,7 @@ class PluginLoader:
warnings.simplefilter("ignore", RuntimeWarning)
with open(to_bytes(path), 'rb') as module_file:
# to_native is used here because imp.load_source's path is for tracebacks and python's traceback formatting uses native strings
- module = imp.load_source(full_name, to_native(path), module_file)
+ module = imp.load_source(to_native(full_name), to_native(path), module_file)
return module
def _update_object(self, obj, name, path):
@@ -622,7 +622,7 @@ def _load_plugin_filter():
if 'stat' in filters['ansible.modules']:
raise AnsibleError('The stat module was specified in the module blacklist file, {0}, but'
' Ansible will not function without the stat module. Please remove stat'
- ' from the blacklist.'.format(filter_cfg))
+ ' from the blacklist.'.format(to_native(filter_cfg)))
return filters