From a5909205a054a350d300020619d4f6e1cc9e3c1f Mon Sep 17 00:00:00 2001 From: Maximilian Moser <maximilian.moser@tuwien.ac.at> Date: Thu, 22 Feb 2024 14:43:42 +0100 Subject: [PATCH] Catch ValueError in formatscaper subprocesses * these can happen if the error log file gets closed while the subprocesses are still writing to it, which can happen if the user aborts the execution with ^C --- formatscaper/formatscaper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formatscaper/formatscaper.py b/formatscaper/formatscaper.py index 2b05b33..b2e6590 100755 --- a/formatscaper/formatscaper.py +++ b/formatscaper/formatscaper.py @@ -233,7 +233,7 @@ def process_record_file(record_file: RecordFile) -> None: if not args.no_progressbar: progress_bar.update(completed_tasks, force=True) - except subprocess.CalledProcessError as e: + except (subprocess.CalledProcessError, ValueError) as e: print("WARN: error during sf execution:", str(e), file=sys.stderr) -- GitLab