mirror of
https://github.com/Kozea/Radicale.git
synced 2025-07-05 17:08:29 +00:00
Ignore configuration file if access denied
Fixes #1215
Bug was introduced in 4c44940ec1
This commit is contained in:
parent
b04938b088
commit
34b2602563
1 changed files with 2 additions and 1 deletions
|
@ -283,7 +283,8 @@ def load(paths: Optional[Iterable[Tuple[str, bool]]] = None
|
||||||
config = {s: {o: parser[s][o] for o in parser.options(s)}
|
config = {s: {o: parser[s][o] for o in parser.options(s)}
|
||||||
for s in parser.sections()}
|
for s in parser.sections()}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if not ignore_if_missing or not isinstance(e, FileNotFoundError):
|
if not (ignore_if_missing and
|
||||||
|
isinstance(e, (FileNotFoundError, PermissionError))):
|
||||||
raise RuntimeError("Failed to load %s: %s" % (config_source, e)
|
raise RuntimeError("Failed to load %s: %s" % (config_source, e)
|
||||||
) from e
|
) from e
|
||||||
config = Configuration.SOURCE_MISSING
|
config = Configuration.SOURCE_MISSING
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue