summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaiphi <maiphi.public@gmx.net>2019-11-01 13:11:10 (GMT)
committermaiphi <maiphi.public@gmx.net>2019-11-01 13:11:10 (GMT)
commit0951e5d691487033bae283d98c45ccbcf3ae822d (patch)
tree9d4a8579cbea85e73b9475d8c9469f6fd5994969
parentc6ca3bdd2ad8e9a6ceea398934d84def9ba7c497 (diff)
downloadSCons-0951e5d691487033bae283d98c45ccbcf3ae822d.zip
SCons-0951e5d691487033bae283d98c45ccbcf3ae822d.tar.gz
SCons-0951e5d691487033bae283d98c45ccbcf3ae822d.tar.bz2
Tex builder: avoid error when reading non-utf-8 log files
Python 3 throws a UnicodeDecodeError when reading a non-utf-8 file in text mode with default (utf-8) encoding. This happens when T1 fontenc is used in Latex and a warning in the log file contains e.g. umlauts. Invalid characters are now replaced.
-rw-r--r--src/engine/SCons/Tool/tex.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py
index 64b9d3b..5cf7bca 100644
--- a/src/engine/SCons/Tool/tex.py
+++ b/src/engine/SCons/Tool/tex.py
@@ -297,8 +297,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
logfilename = targetbase + '.log'
logContent = ''
if os.path.isfile(logfilename):
- with open(logfilename, "r") as f:
- logContent = f.read()
+ with open(logfilename, "rb") as f:
+ logContent = f.read().decode(errors='replace')
# Read the fls file to find all .aux files