From a8e6577403ea7589e47223d46f43c9dfdb14ae3c Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 16 Jan 2019 09:47:48 -0800 Subject: [PATCH] Fix path encoding issue loading plugins. --- lib/ansible/plugins/loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py index ac94a22cc5..86dee7652a 100644 --- a/lib/ansible/plugins/loader.py +++ b/lib/ansible/plugins/loader.py @@ -18,7 +18,7 @@ from collections import defaultdict from ansible import constants as C from ansible.errors import AnsibleError -from ansible.module_utils._text import to_text +from ansible.module_utils._text import to_bytes, to_text from ansible.parsing.utils.yaml import from_yaml from ansible.plugins import get_plugin_class, MODULE_CACHE, PATH_CACHE, PLUGIN_PATH_CACHE from ansible.utils.display import Display @@ -351,7 +351,7 @@ class PluginLoader: with warnings.catch_warnings(): warnings.simplefilter("ignore", RuntimeWarning) with open(path, 'rb') as module_file: - module = imp.load_source(full_name, path, module_file) + module = imp.load_source(full_name, to_bytes(path), module_file) return module def _update_object(self, obj, name, path):