浏览代码

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()".
Thomas Waldmann 3 年之前
父节点
当前提交
18eb696a17
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/borg/helpers/process.py

+ 2 - 1
src/borg/helpers/process.py

@@ -332,7 +332,8 @@ def create_filter_process(cmd, stream, stream_close, inbound=True):
     except Exception:
     except Exception:
         # something went wrong with processing the stream by borg
         # something went wrong with processing the stream by borg
         logger.debug('Exception, killing the filter...')
         logger.debug('Exception, killing the filter...')
-        proc.kill()
+        if cmd:
+            proc.kill()
         borg_succeeded = False
         borg_succeeded = False
         raise
         raise
     else:
     else: