From a2a586e369eaf5b81a5786861a7cf4fd9a93f7cd Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 25 Sep 2024 00:41:55 -0700 Subject: [PATCH] fix system.run not using text arg --- archivebox/system.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/archivebox/system.py b/archivebox/system.py index 58571000..ab5d30ea 100644 --- a/archivebox/system.py +++ b/archivebox/system.py @@ -22,6 +22,8 @@ def run(cmd, *args, input=None, capture_output=True, timeout=None, check=False, Mostly copied from https://github.com/python/cpython/blob/master/Lib/subprocess.py """ + cmd = [str(arg) for arg in cmd] + if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') @@ -38,7 +40,7 @@ def run(cmd, *args, input=None, capture_output=True, timeout=None, check=False, if isinstance(cmd, (list, tuple)) and cmd[0].endswith('.py'): cmd = (PYTHON_BINARY, *cmd) - with Popen(cmd, *args, start_new_session=start_new_session, **kwargs) as process: + with Popen(cmd, *args, start_new_session=start_new_session, text=text, **kwargs) as process: pgid = os.getpgid(process.pid) try: stdout, stderr = process.communicate(input, timeout=timeout)