From 1828b14790f5689d9caa57fea18bb03294a3f3e4 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Thu, 3 Oct 2019 21:22:47 -0500 Subject: [PATCH] Fixed unicodeError in documentation importer for python 3.7.4 --- doc/documentation_importer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/documentation_importer.py b/doc/documentation_importer.py index cfe00765..7fc927aa 100644 --- a/doc/documentation_importer.py +++ b/doc/documentation_importer.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +from codecs import open """ This script converts the hold documentation (saved in markdown files) in a python file with a list of strings to translate it using gettext.""" def prepare_documentation_in_file(fileSource, fileDest): @@ -6,8 +7,8 @@ def prepare_documentation_in_file(fileSource, fileDest): @fileSource str: A markdown(.md) file. @fileDest str: A file where this will put the new strings""" - f1 = open(fileSource, "r") - f2 = open(fileDest, "w") + f1 = open(fileSource, "r", encoding="utf-8") + f2 = open(fileDest, "w", encoding="utf-8") lns = f1.readlines() f2.write("# -*- coding: utf-8 -*-\n") f2.write("documentation = [\n")