From 54867b4add1c5fa4451fcb6f14260d2ba59ca131 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 16 Jan 2019 11:16:54 -0800 Subject: [PATCH] Add comment explaining to_native usage. --- lib/ansible/plugins/loader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/plugins/loader.py b/lib/ansible/plugins/loader.py index f9a20748a0..fad424d31c 100644 --- a/lib/ansible/plugins/loader.py +++ b/lib/ansible/plugins/loader.py @@ -351,6 +351,7 @@ class PluginLoader: with warnings.catch_warnings(): 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) return module