From 6fd3e6042ea7301dfb0eceabe3179616ea9c5bec Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 27 Aug 2025 17:03:14 +0100 Subject: [PATCH] Improvements to logging output for config file issues --- src/manage/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/manage/config.py b/src/manage/config.py index 7518a41..af7b3a7 100644 --- a/src/manage/config.py +++ b/src/manage/config.py @@ -92,15 +92,15 @@ def load_config(root, override_file, schema): def load_one_config(cfg, file, schema, *, overwrite=False): - LOGGER.verbose("Loading configuration from %s", file) try: with open(file, "r", encoding="utf-8-sig") as f: + LOGGER.verbose("Loading configuration from %s", file) cfg2 = json.load(f) except FileNotFoundError: LOGGER.verbose("Skipping configuration at %s because it does not exist", file) return except OSError as ex: - LOGGER.warn("Failed to read %s: %s", file, ex) + LOGGER.warn("Failed to read configuration from %s: %s", file, ex) LOGGER.debug("TRACEBACK:", exc_info=True) return except ValueError as ex: @@ -159,6 +159,9 @@ def _sub(m): def resolve_config(cfg, source, relative_to, key_so_far="", schema=None, error_unknown=False): for k, v in list(cfg.items()): + if k.startswith("#"): + continue + try: subschema = schema[k] except LookupError: