ansible-test sanity: fix UnicodeDecodeError for `--python 2.7 --docker` (#72623) (#72866)

* Store target paths as unicode.

* Add changelog fragment.

(cherry picked from commit f94ba68d8f)
pull/73903/head
Felix Fontein 5 years ago committed by GitHub
parent a4ba6ace01
commit 9ba34dec35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- "ansible-test - convert target paths to unicode on Python 2 to avoid ``UnicodeDecodeError`` (https://github.com/ansible/ansible/issues/68398, https://github.com/ansible/ansible/pull/72623)."

@ -144,7 +144,7 @@ def filter_targets(targets, # type: t.Iterable[TCompletionTarget]
continue
if directories and matched_directories:
yield DirectoryTarget(sorted(matched_directories, key=len)[0], target.modules)
yield DirectoryTarget(to_text(sorted(matched_directories, key=len)[0]), target.modules)
else:
yield target
@ -278,7 +278,7 @@ def walk_integration_targets():
paths.append(os.path.sep.join(path_tuple))
for path in paths:
yield IntegrationTarget(path, modules, prefixes)
yield IntegrationTarget(to_text(path), modules, prefixes)
def load_integration_prefixes():
@ -327,7 +327,7 @@ def walk_test_targets(path=None, module_path=None, extensions=None, prefix=None,
if symlink and not include_symlinks:
continue
yield TestTarget(file_path, module_path, prefix, path, symlink)
yield TestTarget(to_text(file_path), module_path, prefix, path, symlink)
file_paths = []

Loading…
Cancel
Save