From cc2cee6980dc53378b16d42c7988524c5e1be83b Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Mon, 29 Jun 2020 18:02:03 -0500 Subject: Fix -vvvvv unicode error in executor.module_common (#70368) Change: - Fix a UnicodeDecodeError in executor.module_common that could get triggered with -vvvvv. Test Plan: - `ansible-test integration --docker centos7 module_utils -vvvvv` This would show the error previously, and no loner does after this patch. Signed-off-by: Rick Elrod --- lib/ansible/executor/module_common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/ansible/executor/module_common.py') diff --git a/lib/ansible/executor/module_common.py b/lib/ansible/executor/module_common.py index 429bfbb10e..c4b799f450 100644 --- a/lib/ansible/executor/module_common.py +++ b/lib/ansible/executor/module_common.py @@ -904,7 +904,8 @@ def recursive_finder(name, module_fqn, data, py_module_names, py_module_cache, z py_module_file_name = '%s.py' % py_module_path zf.writestr(py_module_file_name, py_module_cache[py_module_name][0]) - display.vvvvv("Using module_utils file %s" % py_module_cache[py_module_name][1]) + mu_file = to_text(py_module_cache[py_module_name][1], errors='surrogate_or_strict') + display.vvvvv("Using module_utils file %s" % mu_file) # Add the names of the files we're scheduling to examine in the loop to # py_module_names so that we don't re-examine them in the next pass -- cgit v1.2.1