From 6b70ee23abf434f82cf98f42f1eb4a3156bb21bd Mon Sep 17 00:00:00 2001 From: Nick Irvine Date: Wed, 21 May 2014 19:24:28 -0700 Subject: [PATCH] Clean non-printable chars from stdout instead of dropping the whole thing --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index adc9b7bcbd1..077724f9f30 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -877,7 +877,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']