From 1a80d7b28f8d13798fceff57463c2223c8908c1e Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 26 Jun 2018 10:10:57 -0700 Subject: Fix Issue #3141. Unicode in TryAction crashing. Use get_text_contents instead of get_contents().decode() (get_contents should always be bytes, but not always decode()'able (without specifying encoding) --- src/CHANGES.txt | 1 + src/engine/SCons/SConf.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b0baecb..4be9068 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -45,6 +45,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE - Re-Enable parallel SCons (-j) when running via Pypy - Move SCons test framework files to testing/framework and remove all references to QMtest. QMTest has not been used by SCons for some time now. + - Fix GH Issue #3141 unicode string in a TryAction() with python 2.7 crashes. From Andrew Featherstone - Removed unused --warn options from the man page and source code. diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index 48eed8e..a14127e 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -609,7 +609,7 @@ class SConfBase(object): ok = self.TryBuild(self.env.SConfActionBuilder, text, extension) del self.env['BUILDERS']['SConfActionBuilder'] if ok: - outputStr = self.lastTarget.get_contents().decode() + outputStr = self.lastTarget.get_text_contents() return (1, outputStr) return (0, "") -- cgit v0.12