From dbe1c6ccae4f9db2e4459926accde38029c07d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 16 Sep 2019 19:13:21 +0200 Subject: [PATCH] build: be explicit about json file encoding --- create_themes_json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create_themes_json.py b/create_themes_json.py index 41edc3e8..f0332d5d 100644 --- a/create_themes_json.py +++ b/create_themes_json.py @@ -15,7 +15,7 @@ for dirname in sorted(os.listdir('static')): config = os.path.join('static', dirname, 'config.json') if not os.path.exists(config): continue - theme = json.load(open(os.path.join('static', dirname, 'config.json'))) + theme = json.load(open(os.path.join('static', dirname, 'config.json'), encoding='utf-8')) theme['id'] = dirname if not 'variables' in theme: theme['variables'] = {} @@ -57,5 +57,5 @@ if os.path.exists('help/fr/misc-scss.page'): } -with open('themes.json', 'w') as fd: +with open('themes.json', 'w', encoding='utf-8') as fd: json.dump({'themes': themes, 'parameters': parameters}, fd, indent=2, sort_keys=True)