dialog: Open template file as utf8 encoded
To avoid UnicodeDecodeError's when opening files tell Python that we want to open the file as a utf8 encoded file. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>pull/1958/head
parent
ce37c7861b
commit
4c140c3cfe
|
@ -43,7 +43,7 @@ class MustacheDialogRenderer:
|
|||
template_name (str): a unique identifier for a group of templates
|
||||
filename (str): a fully qualified filename of a mustache template.
|
||||
"""
|
||||
with open(filename, 'r') as f:
|
||||
with open(filename, 'r', encoding='utf8') as f:
|
||||
for line in f:
|
||||
template_text = line.strip()
|
||||
# Skip all lines starting with '#' and all empty lines
|
||||
|
|
Loading…
Reference in New Issue