# HG changeset patch # User Edouard Tisserant # Date 1708425474 -3600 # Node ID 1675b5533e9e9fbc5ac29b5a235333e9abd8e12b # Parent 0f375805097a4794d75147d2d02d973dfe5ff33d Fix argument lexer in ProcessLogger, replace it with shlex standard python module. diff -r 0f375805097a -r 1675b5533e9e util/ProcessLogger.py --- a/util/ProcessLogger.py Tue Feb 20 11:34:28 2024 +0100 +++ b/util/ProcessLogger.py Tue Feb 20 11:37:54 2024 +0100 @@ -28,6 +28,7 @@ import subprocess import ctypes import time +import shlex from threading import Timer, Lock, Thread, Semaphore, Condition import signal @@ -82,16 +83,9 @@ self.logger = logger if not isinstance(Command, list): self.Command_str = Command - self.Command = [] - for i, word in enumerate(Command.replace("'", '"').split('"')): - if i % 2 == 0: - word = word.strip() - if len(word) > 0: - self.Command.extend(word.split()) - else: - self.Command.append(word) - else: - self.Command = [x if type(x)==str else x.decode() for x in Command] + self.Command = shlex.split(Command) + else: + self.Command = Command self.Command_str = subprocess.list2cmdline(self.Command) fsencoding = sys.getfilesystemencoding()