From f48eb6d94ec9bed55745ebc0e8cb2b311e14615b Mon Sep 17 00:00:00 2001 From: fwcd Date: Wed, 9 Jan 2019 23:44:59 +0100 Subject: [PATCH 1/2] Made sure to always encode written TeX files as UTF-8 --- manimlib/utils/tex_file_writing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manimlib/utils/tex_file_writing.py b/manimlib/utils/tex_file_writing.py index 7bfcbf1b..1c296d29 100644 --- a/manimlib/utils/tex_file_writing.py +++ b/manimlib/utils/tex_file_writing.py @@ -1,5 +1,6 @@ import os import hashlib +import codecs from manimlib.constants import TEX_DIR from manimlib.constants import TEX_TEXT_TO_REPLACE @@ -32,7 +33,7 @@ def generate_tex_file(expression, template_tex_file_body): new_body = template_tex_file_body.replace( TEX_TEXT_TO_REPLACE, expression ) - with open(result, "w") as outfile: + with open(result, "w", encoding="utf-8") as outfile: outfile.write(new_body) return result From dee8101991ecf4f962b82cae0992c995edb36f8f Mon Sep 17 00:00:00 2001 From: fwcd Date: Wed, 9 Jan 2019 23:53:38 +0100 Subject: [PATCH 2/2] Removed redundant import --- manimlib/utils/tex_file_writing.py | 1 - 1 file changed, 1 deletion(-) diff --git a/manimlib/utils/tex_file_writing.py b/manimlib/utils/tex_file_writing.py index 1c296d29..1ebd3a82 100644 --- a/manimlib/utils/tex_file_writing.py +++ b/manimlib/utils/tex_file_writing.py @@ -1,6 +1,5 @@ import os import hashlib -import codecs from manimlib.constants import TEX_DIR from manimlib.constants import TEX_TEXT_TO_REPLACE