From 38590fbab9288bb591a819b9ef1ac16b6f7ff87d Mon Sep 17 00:00:00 2001 From: art-at-sky Date: Fri, 17 Jun 2016 20:02:01 +0100 Subject: [PATCH] Fix string coercion problem in error handling code 10:50 (#16270) Manifests as the following stack trace File "/usr/local/Cellar/ansible/2.0.1.0/libexec/lib/python2.7/site-packages/ansible/utils/display.py", line 259, in error new_msg = u"ERROR! " + msg TypeError: coercing to Unicode: need string or buffer, AnsibleParserError found --- lib/ansible/utils/display.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index c1f5d20ad71..93df39bb1da 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -278,7 +278,7 @@ class Display: wrapped = textwrap.wrap(new_msg, self.columns) new_msg = u"\n".join(wrapped) + u"\n" else: - new_msg = u"ERROR! " + msg + new_msg = u"ERROR! %s" % msg if new_msg not in self._errors: self.display(new_msg, color=C.COLOR_ERROR, stderr=True) self._errors[new_msg] = 1