From 9dd54c421b835d0dde14291160237d2e176d3869 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Mon, 16 Mar 2020 13:53:56 -0300 Subject: [PATCH] Fixed UnicodeEncodeError: 'charmap' codec can't encode character '\u2068' in position 2724: character maps to for pylib/tests/test_stats.py --- pylib/tests/test_stats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylib/tests/test_stats.py b/pylib/tests/test_stats.py index 7de3dc831..045983ac0 100644 --- a/pylib/tests/test_stats.py +++ b/pylib/tests/test_stats.py @@ -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