1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix TypeError: coercing to Unicode: need string or buffer, AnsibleParserError found

This commit is contained in:
qqo 2016-03-16 23:47:16 +03:00
parent 61f05c2e8d
commit d1e0719e4c

View file

@ -108,7 +108,7 @@ class Display:
""" Display a message to the user """ Display a message to the user
Note: msg *must* be a unicode string to prevent UnicodeError tracebacks. Note: msg *must* be a unicode string to prevent UnicodeError tracebacks.
""" """
# FIXME: this needs to be implemented # FIXME: this needs to be implemented
#msg = utils.sanitize_output(msg) #msg = utils.sanitize_output(msg)
@ -273,7 +273,7 @@ class Display:
wrapped = textwrap.wrap(new_msg, self.columns) wrapped = textwrap.wrap(new_msg, self.columns)
new_msg = u"\n".join(wrapped) + u"\n" new_msg = u"\n".join(wrapped) + u"\n"
else: else:
new_msg = u"ERROR! " + msg new_msg = u"ERROR! %s" % msg
if new_msg not in self._errors: if new_msg not in self._errors:
self.display(new_msg, color=C.COLOR_ERROR, stderr=True) self.display(new_msg, color=C.COLOR_ERROR, stderr=True)
self._errors[new_msg] = 1 self._errors[new_msg] = 1