Commit 57dee454 by Chris Church

Make sure cmd is UTF8 encoded before splitting. Fixes regression introduced by…

Make sure cmd is UTF8 encoded before splitting. Fixes regression introduced by 80df2135.
parent a419ffdf
...@@ -103,6 +103,7 @@ class ShellModule(object): ...@@ -103,6 +103,7 @@ class ShellModule(object):
return _encode_script(script) return _encode_script(script)
def build_module_command(self, env_string, shebang, cmd, rm_tmp=None): def build_module_command(self, env_string, shebang, cmd, rm_tmp=None):
cmd = cmd.encode('utf-8')
cmd_parts = shlex.split(cmd, posix=False) cmd_parts = shlex.split(cmd, posix=False)
if not cmd_parts[0].lower().endswith('.ps1'): if not cmd_parts[0].lower().endswith('.ps1'):
cmd_parts[0] = '%s.ps1' % cmd_parts[0] cmd_parts[0] = '%s.ps1' % cmd_parts[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment