diff options
author | William Blevins <wblevins001@gmail.com> | 2016-09-24 10:03:34 (GMT) |
---|---|---|
committer | William Blevins <wblevins001@gmail.com> | 2016-09-24 10:03:34 (GMT) |
commit | db1903ca5df83294d9f38f521058b75a7f647c1c (patch) | |
tree | 442e799f1deee84bf28b0e1fcb72ef9733ea8717 /src/engine/SCons/Node | |
parent | c4c2ba91c671527828fbc6ffb79421d5e487a398 (diff) | |
download | SCons-db1903ca5df83294d9f38f521058b75a7f647c1c.zip SCons-db1903ca5df83294d9f38f521058b75a7f647c1c.tar.gz SCons-db1903ca5df83294d9f38f521058b75a7f647c1c.tar.bz2 |
Ensuring that FS.get_text_contents returns actual text.
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 9b7e105..0de3989 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -696,7 +696,7 @@ class Base(SCons.Node.Node): return self._memo['_save_str'] except KeyError: pass - result = sys.intern(self._get_str()) + result = SCons.Util.silent_intern(self._get_str()) self._memo['_save_str'] = result return result @@ -2670,7 +2670,11 @@ class File(Base): return contents[len(codecs.BOM_UTF16_LE):].decode('utf-16-le') if contents.startswith(codecs.BOM_UTF16_BE): return contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be') - return contents + try: + return contents.decode() + except UnicodeDecodeError: + return contents + def get_content_hash(self): """ |