Forces utf-8 encoding of opened files
This commit is contained in:
parent
d8499579e3
commit
f40a8d54fe
1 changed files with 4 additions and 4 deletions
8
main.py
8
main.py
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue