Fixed UnicodeEncodeError: 'charmap' codec can't encode character

'\u2068' in position 2724: character maps to <undefined> for
pylib/tests/test_stats.py
This commit is contained in:
evandrocoan 2020-03-16 13:53:56 -03:00
parent dfa10f5a1c
commit 9dd54c421b

View File

@ -1,4 +1,5 @@
# coding: utf-8
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import os
import tempfile
@ -34,6 +35,6 @@ def test_graphs():
d = aopen(os.path.join(dir, "test.anki2"))
g = d.stats()
rep = g.report()
with open(os.path.join(dir, "test.html"), "w") as f:
with open(os.path.join(dir, "test.html"), "w", encoding="UTF-8") as f:
f.write(rep)
return