diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 8e326935b0..e376a87b92 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -1067,7 +1067,7 @@ class Runner(object): if hasattr(sys.stdout, "isatty"): if "stdout" in data and sys.stdout.isatty(): if not string_functions.isprintable(data['stdout']): - data['stdout'] = '' + data['stdout'] = ''.join(c for c in data['stdout'] if string_functions.isprintable(c)) if 'item' in inject: result.result['item'] = inject['item']