summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-08-23 22:21:14 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-08-23 22:21:14 (GMT)
commit38acad8afd2f64dd6e126e359f9d25be177aff2a (patch)
tree287025f92b7b2aa2cbf1efd0039e9d795c1b58d1 /src/engine
parent06509092b4874d87680fd714927c5a3061528e13 (diff)
downloadSCons-38acad8afd2f64dd6e126e359f9d25be177aff2a.zip
SCons-38acad8afd2f64dd6e126e359f9d25be177aff2a.tar.gz
SCons-38acad8afd2f64dd6e126e359f9d25be177aff2a.tar.bz2
Handle decode errors by backslashing character. Should only throw exception if content is not a byte type now
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Node/FS.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 638819a..606ecfd 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -2654,9 +2654,9 @@ class File(Base):
if contents[:len(codecs.BOM_UTF16_BE)] == codecs.BOM_UTF16_BE:
return contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be')
try:
- return contents.decode()
+ return contents.decode('utf-8',errors='backslashreplace')
except (UnicodeDecodeError, AttributeError) as e:
- return contents.decode('utf-8')
+ return contents
def get_content_hash(self):