fix: add --non-interactive to git_to_svn._run_svn, fix stdin/input exclusivity

This commit is contained in:
2026-06-24 11:49:40 +02:00
parent 4f41bd3488
commit cf1b7e9994
2 changed files with 22 additions and 16 deletions
+12 -8
View File
@@ -96,16 +96,20 @@ def _run_svn(args: list, input: bytes = None, timeout: int = 120,
"""Run an svn command. If *wc* is given, run from that directory."""
if auth_args:
args = auth_args + args
args = ["--non-interactive"] + args
env = {**os.environ, "LC_ALL": "C.UTF-8"}
kwargs = dict(
capture_output=True,
timeout=timeout,
cwd=str(wc) if wc else None,
env=env,
)
if input is not None:
kwargs["input"] = input
else:
kwargs["stdin"] = subprocess.DEVNULL
try:
r = subprocess.run(
["svn"] + args,
input=input,
capture_output=True,
timeout=timeout,
cwd=str(wc) if wc else None,
env=env,
)
r = subprocess.run(["svn"] + args, **kwargs)
except FileNotFoundError:
raise GitToSVNError("svn CLI not found is subversion installed?")
except subprocess.TimeoutExpired: