Commit 261788dd authored by segfault's avatar segfault

Log invalid settings lines (refs: #17136)

parent 9d04c892
import logging
import os
import shlex
from typing import Dict, Union
......@@ -23,7 +24,8 @@ def read_settings(filename: str) -> Dict[str, str]:
for line in lines:
try:
key, value = line.split('=', 1)
except ValueError:
except ValueError as e:
logging.warning("Error parsing settings file \"%s\", line \"%s\": %s", filename, line, e)
continue
settings[key] = value.rstrip()
return settings
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment