From a9688f21a810e6e8b1b6b047163ce13bef86746f Mon Sep 17 00:00:00 2001 From: Unrud Date: Thu, 14 Apr 2022 16:25:31 +0200 Subject: [PATCH] Ignore NotADirectoryError for optional config files Fixes #1234 --- radicale/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/config.py b/radicale/config.py index a9b7d7f2..02a0b381 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -283,8 +283,8 @@ def load(paths: Optional[Iterable[Tuple[str, bool]]] = None config = {s: {o: parser[s][o] for o in parser.options(s)} for s in parser.sections()} except Exception as e: - if not (ignore_if_missing and - isinstance(e, (FileNotFoundError, PermissionError))): + if not (ignore_if_missing and isinstance(e, ( + FileNotFoundError, NotADirectoryError, PermissionError))): raise RuntimeError("Failed to load %s: %s" % (config_source, e) ) from e config = Configuration.SOURCE_MISSING