mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-12 22:25:44 -04:00
fix system.run not using text arg
This commit is contained in:
parent
5b6cf68d98
commit
a2a586e369
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue