summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-08-24 17:16:58 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-08-24 17:16:58 (GMT)
commitc0267abfae58e329ecb622ffe9853716e575e701 (patch)
treed5a657ccbedeed832c974f45f86914d7db94dffd /src
parentcd59c53edd4e326279ddee934436a2aba055df5f (diff)
parentd8b5708708f3a71ae04a5b8d44a89d5a3d315adb (diff)
downloadSCons-c0267abfae58e329ecb622ffe9853716e575e701.zip
SCons-c0267abfae58e329ecb622ffe9853716e575e701.tar.gz
SCons-c0267abfae58e329ecb622ffe9853716e575e701.tar.bz2
Merged in bdbaddog/scons (pull request #505)
Fix handling of non ascii/not utf-8 file contents for PY3 in get_text_contents()
Diffstat (limited to 'src')
-rw-r--r--src/Announce.txt2
-rw-r--r--src/CHANGES.txt4
-rw-r--r--src/RELEASE.txt2
-rw-r--r--src/engine/SCons/Node/FS.py9
-rw-r--r--src/engine/SCons/Node/FSTests.py8
-rw-r--r--src/setup.cfg3
6 files changed, 21 insertions, 7 deletions
diff --git a/src/Announce.txt b/src/Announce.txt
index 112d6f0..fb7d0ea 100644
--- a/src/Announce.txt
+++ b/src/Announce.txt
@@ -18,7 +18,7 @@ So that everyone using SCons can help each other learn how to use it more
effectively, please go to http://scons.org/lists.html#users to sign up for
the scons-users mailing list.
-RELEASE 3.0.0.alpha.20170614 - Mon, 14 Jun 2017 12:23:56 -0400
+RELEASE 3.0.0.alpha.20170821 - Mon, 21 Aug 2017 16:15:02 -0700
Please consult the RELEASE.txt file for a summary of changes since the last
release and consult the CHANGES.txt file for complete a list of changes
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index c2c8ca8..2f04031 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -5,7 +5,7 @@
Change Log
-RELEASE 3.0.0.alpha.20170614 - Mon, 14 Jun 2017 12:23:56 -0400
+RELEASE 3.0.0.alpha.20170821 - Mon, 21 Aug 2017 16:15:02 -0700
NOTE: This is a major release. You should expect that some targets may rebuild when upgrading.
Significant changes in some python action signatures. Also switching between PY 2 and PY 3.5, 3.6
@@ -81,7 +81,7 @@ may cause rebuilds. In no case should rebuilds not happen.
https://github.com/Microsoft/vswhere
From Paweł Tomulik:
- - Fixed the issue with LDMODULEVERSIONFLAGS reported by Tim Jennes
+ - Fixed the issue with LDMODULEVERSIONFLAGS reported by Tim Jenness
(https://pairlist4.pair.net/pipermail/scons-users/2016-May/004893.html).
An error was causing "-Wl,Bsymbolic" being added to linker's command-line
even when there was no specified value in LDMODULEVERSION and thus no
diff --git a/src/RELEASE.txt b/src/RELEASE.txt
index b08b3f7..bbc1e42 100644
--- a/src/RELEASE.txt
+++ b/src/RELEASE.txt
@@ -1,4 +1,4 @@
- A new SCons checkpoint release, 3.0.0.alpha.20170614, is now available
+ A new SCons checkpoint release, 3.0.0.alpha.20170821, is now available
on the SCons download page:
http://www.scons.org/download.php
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 8c1161d..c31ac6c 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -2654,9 +2654,12 @@ 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()
- except (UnicodeDecodeError, AttributeError) as e:
- return contents
+ return contents.decode('utf-8')
+ except UnicodeDecodeError as e:
+ try:
+ return contents.decode('latin-1')
+ except UnicodeDecodeError as e:
+ return contents.decode('utf-8', error='backslashreplace')
def get_content_hash(self):
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 399ac06..273f809 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -1315,6 +1315,14 @@ class FSTestCase(_tempdirTestCase):
assert eval('f1.get_text_contents() == u"Foo\x1aBar"'), \
f1.get_text_contents()
+ # Check for string which doesn't have BOM and isn't valid
+ # ASCII
+ test_string = b'Gan\xdfauge'
+ test.write('latin1_file', test_string)
+ f1 = fs.File(test.workpath("latin1_file"))
+ assert f1.get_text_contents() == test_string.decode('latin-1'), \
+ f1.get_text_contents()
+
def nonexistent(method, s):
try:
x = method(s, create = 0)
diff --git a/src/setup.cfg b/src/setup.cfg
index f04ca1b..bda7571 100644
--- a/src/setup.cfg
+++ b/src/setup.cfg
@@ -3,3 +3,6 @@ group = Development/Tools
[bdist_wininst]
title = SCons - a software construction tool
+
+[bdist_wheel]
+universal=1