From 57dee4545b3c34d1e66943def8d5e45ee95d66bd Mon Sep 17 00:00:00 2001 From: Chris Church Date: Sun, 24 Aug 2014 21:06:21 -0400 Subject: [PATCH] Make sure cmd is UTF8 encoded before splitting. Fixes regression introduced by 80df2135e903bc167b70cd1a45e8d4eb803e87ed. --- lib/ansible/runner/shell_plugins/powershell.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/runner/shell_plugins/powershell.py b/lib/ansible/runner/shell_plugins/powershell.py index 2047913ad7..be005aa7af 100644 --- a/lib/ansible/runner/shell_plugins/powershell.py +++ b/lib/ansible/runner/shell_plugins/powershell.py @@ -103,6 +103,7 @@ class ShellModule(object): return _encode_script(script) def build_module_command(self, env_string, shebang, cmd, rm_tmp=None): + cmd = cmd.encode('utf-8') cmd_parts = shlex.split(cmd, posix=False) if not cmd_parts[0].lower().endswith('.ps1'): cmd_parts[0] = '%s.ps1' % cmd_parts[0]