Skip to content
Snippets Groups Projects
Commit cee91528 authored by Dirk Sarpe's avatar Dirk Sarpe
Browse files

change to python3

open the file in binary mode and encode utf8 gives the same result
as the python2 open and encode utf8
parent 6a98de04
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ def calendarlist2jinja(html_list, filename): ...@@ -60,7 +60,7 @@ def calendarlist2jinja(html_list, filename):
j2_env = Environment(loader=FileSystemLoader(this_dir), j2_env = Environment(loader=FileSystemLoader(this_dir),
trim_blocks=True) trim_blocks=True)
output = j2_env.get_template('template.html').render(html_list=html_list) output = j2_env.get_template('template.html').render(html_list=html_list)
out_file = open(this_dir + filename, "w") out_file = open(this_dir + filename, "wb")
out_file.write(output.encode("utf-8")) out_file.write(output.encode("utf-8"))
out_file.close() out_file.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment