Skip to content

Commit 47c90a9

Browse files
authored
Improvements to logging output for config file issues (#156)
1 parent 200f509 commit 47c90a9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/manage/config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ def load_config(root, override_file, schema):
9292

9393

9494
def load_one_config(cfg, file, schema, *, overwrite=False):
95-
LOGGER.verbose("Loading configuration from %s", file)
9695
try:
9796
with open(file, "r", encoding="utf-8-sig") as f:
97+
LOGGER.verbose("Loading configuration from %s", file)
9898
cfg2 = json.load(f)
9999
except FileNotFoundError:
100100
LOGGER.verbose("Skipping configuration at %s because it does not exist", file)
101101
return
102102
except OSError as ex:
103-
LOGGER.warn("Failed to read %s: %s", file, ex)
103+
LOGGER.warn("Failed to read configuration from %s: %s", file, ex)
104104
LOGGER.debug("TRACEBACK:", exc_info=True)
105105
return
106106
except ValueError as ex:
@@ -159,6 +159,9 @@ def _sub(m):
159159

160160
def resolve_config(cfg, source, relative_to, key_so_far="", schema=None, error_unknown=False):
161161
for k, v in list(cfg.items()):
162+
if k.startswith("#"):
163+
continue
164+
162165
try:
163166
subschema = schema[k]
164167
except LookupError:

0 commit comments

Comments
 (0)