fix: add --non-interactive, stdin=DEVNULL, and LC_ALL env to svn._run_svn
This commit is contained in:
@@ -32,12 +32,16 @@ def _run_svn(args: list, input: bytes = None, timeout: int = 120,
|
|||||||
auth_args: Optional[list] = None) -> subprocess.CompletedProcess:
|
auth_args: Optional[list] = None) -> subprocess.CompletedProcess:
|
||||||
if auth_args:
|
if auth_args:
|
||||||
args = auth_args + args
|
args = auth_args + args
|
||||||
|
args = ["--non-interactive"] + args
|
||||||
|
env = {**os.environ, "LC_ALL": "C.UTF-8"}
|
||||||
try:
|
try:
|
||||||
r = subprocess.run(
|
r = subprocess.run(
|
||||||
["svn"] + args,
|
["svn"] + args,
|
||||||
|
stdin=subprocess.DEVNULL,
|
||||||
input=input,
|
input=input,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
|
env=env,
|
||||||
)
|
)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
raise SVNError("svn CLI not found – is subversion installed?")
|
raise SVNError("svn CLI not found – is subversion installed?")
|
||||||
|
|||||||
Reference in New Issue
Block a user