Fix ansible-test encoding issues for exceptions.

(cherry picked from commit 0d7a156319)
This commit is contained in:
Matt Clay 2018-10-02 12:21:36 -07:00
parent 0bd9a73d47
commit 3dd444d170
3 changed files with 4 additions and 4 deletions

View file

@ -91,10 +91,10 @@ def main():
display.review_warnings()
except ApplicationWarning as ex:
display.warning(str(ex))
display.warning(u'%s' % ex)
exit(0)
except ApplicationError as ex:
display.error(str(ex))
display.error(u'%s' % ex)
exit(1)
except KeyboardInterrupt:
exit(2)

View file

@ -76,7 +76,7 @@ def command_coverage_combine(args):
try:
original.read_file(coverage_file)
except Exception as ex: # pylint: disable=locally-disabled, broad-except
display.error(str(ex))
display.error(u'%s' % ex)
continue
for filename in original.measured_files():

View file

@ -32,7 +32,7 @@ def find_target_completion(target_func, prefix):
matches = walk_completion_targets(targets, prefix, short)
return matches
except Exception as ex: # pylint: disable=locally-disabled, broad-except
return [str(ex)]
return [u'%s' % ex]
def walk_completion_targets(targets, prefix, short=False):