From 33c16d925f805501a2edb8ec98dd82cc3aa118df Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Thu, 25 Apr 2019 06:32:43 +0200 Subject: [PATCH] Handle OSError 6 when trying to read a socket in .ssh (#269) Fixes #268 --- src/vorta/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 16c184a0..d3b6a602 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -1,4 +1,5 @@ import os +import errno import sys import platform import plistlib @@ -78,6 +79,12 @@ def get_private_keys(): available_private_keys.append(key_details) except (SSHException, UnicodeDecodeError, IsADirectoryError): continue + except OSError as e: + if e.errno == errno.ENXIO: + # when key_file is a (ControlPath) socket + continue + else: + raise return available_private_keys