Commit f40a8d54 authored by Maxime Bombar's avatar Maxime Bombar
Browse files

Forces utf-8 encoding of opened files

parent d8499579
......@@ -35,10 +35,10 @@ def generate(api_client):
template = env.get_template('templates/list_alias')
aliases_rendered = template.render(data=all_users)
fichier = open(path+'/generated/aliases','w')
fichier = open(path+'/generated/aliases','w', encoding='utf-8')
if os.path.isfile(path+'/aliases_local'): # if a local aliases file exist, add it's content at the beginning
local = open(path+'/aliases_local','r')
local = open(path+'/aliases_local','r', encoding='utf-8')
for line in local.readlines():
fichier.write(line)
local.close()
......@@ -50,10 +50,10 @@ def generate(api_client):
template = env.get_template('templates/list_virtual')
virtuals_rendered = template.render(data=all_users)
fichier = open(path+'/generated/virtual','w')
fichier = open(path+'/generated/virtual','w', encoding='utf-8')
if os.path.isfile(path+'/virtuals_local'): # if a local aliases file exist, add it's content at the beginning
local = open(path+'/virtuals_local','r')
local = open(path+'/virtuals_local','r', encoding='utf-8')
for line in local.readlines():
fichier.write(line)
local.close()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment