From a26ea87ddef0018cf98decc227804624d300b992 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Sun, 28 Jul 2019 13:30:06 +0200 Subject: [PATCH] Fix encoding errors config.h is encoded in UTF-8. --- scripts/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config.py b/scripts/config.py index c14d8676e5..67a1f26d47 100755 --- a/scripts/config.py +++ b/scripts/config.py @@ -239,7 +239,7 @@ class ConfigFile(Config): super().__init__() self.filename = filename self.current_section = 'header' - with open(filename) as file: + with open(filename, 'r', encoding='utf-8') as file: self.templates = [self._parse_line(line) for line in file] self.current_section = None @@ -307,7 +307,7 @@ class ConfigFile(Config): """ if filename is None: filename = self.filename - with open(filename, 'w') as output: + with open(filename, 'w', encoding='utf-8') as output: self.write_to_stream(output) if __name__ == '__main__':