From 1652014f9cc8c93912a6289170af036354c8a79c Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 7 Jun 2021 16:28:14 +0200 Subject: [PATCH] fix: fix encoding error if string contains backslashes (#152) --- ansiblelater/rules/CheckNativeYaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansiblelater/rules/CheckNativeYaml.py b/ansiblelater/rules/CheckNativeYaml.py index fbdf01e..9d092a7 100644 --- a/ansiblelater/rules/CheckNativeYaml.py +++ b/ansiblelater/rules/CheckNativeYaml.py @@ -30,7 +30,7 @@ class CheckNativeYaml(StandardBase): if isinstance(task[action], dict): continue # strip additional newlines off task[action] - task_action = bytes(task[action].strip(), "utf-8").decode("unicode_escape") + task_action = bytes(repr(task[action].strip()), "utf-8").decode("unicode_escape") if task_action.split() != arguments: errors.append(self.Error(task["__line__"], self.helptext)) return self.Result(candidate.path, errors)