From 0d7a156319f2b9f1786147bb717ec2b0d7bd6091 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 2 Oct 2018 12:21:36 -0700 Subject: [PATCH] Fix ansible-test encoding issues for exceptions. --- test/runner/lib/cli.py | 4 ++-- test/runner/lib/cover.py | 2 +- test/runner/lib/target.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/runner/lib/cli.py b/test/runner/lib/cli.py index a5ebf1cd402..b77e1af10c6 100644 --- a/test/runner/lib/cli.py +++ b/test/runner/lib/cli.py @@ -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) diff --git a/test/runner/lib/cover.py b/test/runner/lib/cover.py index 0b7dcaa70e9..3d7e1621267 100644 --- a/test/runner/lib/cover.py +++ b/test/runner/lib/cover.py @@ -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(): diff --git a/test/runner/lib/target.py b/test/runner/lib/target.py index 55c3c35d729..cae101564dc 100644 --- a/test/runner/lib/target.py +++ b/test/runner/lib/target.py @@ -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):