tools (common/async_process): remove useless encoding + use full path for command:
- arguments don't need to be encoded anymore, `spawnProcess` handles str directly now - use full path even for first argument: even if first argument should be only executable name, it appears that using full path only in `command` is not enough (seen with Python where system installation is used instead of the VirtualEnv one when full path is not used as first argument).
This commit is contained in:
parent
47968678a6
commit
60fe49f883
1 changed files with 2 additions and 3 deletions
|
|
@ -114,8 +114,7 @@ class CommandProtocol(protocol.ProcessProtocol):
|
|||
if stdin is not None:
|
||||
stdin = stdin.encode('utf-8')
|
||||
verbose = kwargs.pop('verbose', False)
|
||||
args = [a.encode('utf-8') for a in args]
|
||||
kwargs = {k:v.encode('utf-8') for k,v in list(kwargs.items())}
|
||||
args = list(args)
|
||||
d = defer.Deferred()
|
||||
prot = cls(d, stdin=stdin)
|
||||
if verbose:
|
||||
|
|
@ -131,7 +130,7 @@ class CommandProtocol(protocol.ProcessProtocol):
|
|||
prot.name = name
|
||||
else:
|
||||
command = cls.command
|
||||
cmd_args = [os.path.basename(command)] + args
|
||||
cmd_args = [command] + args
|
||||
reactor.spawnProcess(prot,
|
||||
command,
|
||||
cmd_args,
|
||||
|
|
|
|||
Loading…
Reference in a new issue