build: be explicit about json file encoding

This commit is contained in:
Frédéric Péters 2019-09-16 19:13:21 +02:00
parent 73acb53826
commit dbe1c6ccae
1 changed files with 2 additions and 2 deletions

View File

@ -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)