Dont fail for non-UTF-8 encoded config files, simply replace the undecodeable chars instead

This commit is contained in:
Kovid Goyal
2018-03-02 08:49:27 +05:30
parent 721595ef04
commit aad4a1fd6a

View File

@@ -403,7 +403,7 @@ def load_config(*paths, overrides=None) -> Options:
if not path:
continue
try:
f = open(path, encoding='utf-8')
f = open(path, encoding='utf-8', errors='replace')
except FileNotFoundError:
continue
with f: