# HG changeset patch # User Goffi # Date 1627591861 -7200 # Node ID e584ce33ef1d362fb8b6036dca044fc1e60e3948 # Parent d4b8f1e8f0b402be56a6de606c6b2eb5bdb84035 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). (grafted from 25cbaf04772855cd8aead18771465a4f00f5fa03) diff -r d4b8f1e8f0b4 -r e584ce33ef1d sat/tools/common/async_process.py --- a/sat/tools/common/async_process.py Wed Sep 08 11:18:01 2021 +0200 +++ b/sat/tools/common/async_process.py Thu Jul 29 22:51:01 2021 +0200 @@ -114,8 +114,7 @@ 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 @@ prot.name = name else: command = cls.command - cmd_args = [os.path.basename(command)] + args + cmd_args = [command] + args reactor.spawnProcess(prot, command, cmd_args,