Adding upstream version 3.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
3f4c8eaaf4
commit
2f72ef8d68
7 changed files with 27 additions and 45 deletions
9
cfgv.py
9
cfgv.py
|
@ -395,10 +395,13 @@ def load_from_filename(
|
|||
if not os.path.exists(filename):
|
||||
raise ValidationError(f'{filename} does not exist')
|
||||
|
||||
with open(filename, encoding='utf-8') as f:
|
||||
contents = f.read()
|
||||
|
||||
with validate_context(f'File {filename}'):
|
||||
try:
|
||||
with open(filename, encoding='utf-8') as f:
|
||||
contents = f.read()
|
||||
except UnicodeDecodeError as e:
|
||||
raise ValidationError(str(e))
|
||||
|
||||
try:
|
||||
data = load_strategy(contents)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue