Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Re2o
mail-server
Commits
f40a8d54
Commit
f40a8d54
authored
Dec 30, 2018
by
Maxime Bombar
Browse files
Forces utf-8 encoding of opened files
parent
d8499579
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.py
View file @
f40a8d54
...
...
@@ -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
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment