From 18eb696a176e34a64c31d5d3769c8be59bd221ed Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 8 May 2022 18:46:13 +0200 Subject: [PATCH] fix create_filter_process exception handler, fixes #6681 if cmd was falsy (e.g. None), there is no proc. then, if "yield stream" raises an exception, the exception handler crashed at "proc.kill()". --- src/borg/helpers/process.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/borg/helpers/process.py b/src/borg/helpers/process.py index 7af8d5fcb..0cedcb7b7 100644 --- a/src/borg/helpers/process.py +++ b/src/borg/helpers/process.py @@ -332,7 +332,8 @@ def create_filter_process(cmd, stream, stream_close, inbound=True): except Exception: # something went wrong with processing the stream by borg logger.debug('Exception, killing the filter...') - proc.kill() + if cmd: + proc.kill() borg_succeeded = False raise else: