Add utf-8 encoding in latex log opening

By default, open use ascii encoding leading to crash when non ascii caracters are present . Fix it by enforcing UTF-8  encoding
This commit is contained in:
jvanbraekel
2019-07-23 15:52:21 +02:00
committed by GitHub
parent 726d664292
commit a23a068d40

View File

@@ -80,7 +80,7 @@ def latex2pdf(latex, pdflatex='pdflatex', passes=3):
outfile.close()
re_errors = re.compile('^\!(.*)$', re.M)
re_warnings = re.compile('^LaTeX Warning\:(.*)$', re.M)
flog = open(logname)
flog = open(logname,encoding="utf-8")
try:
loglines = flog.read()
finally: