From 2c7b4f7cd5a2277208902c3b59c98b8530fd8698 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 10 Apr 2017 11:40:50 -0700 Subject: py2/3 change to read sconscripts as binary file. at least test/packaging/rpm/internationalization.py was failing because an open in py3 without specified encoding with LANG=C was trying to decode the file as ascii and it contained unicode characters and was failing. So far I haven't found any tests failing from this change --- src/engine/SCons/Script/SConscript.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 8609892..558e28f 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -179,10 +179,10 @@ def _SConscript(fs, *files, **kw): fs.chdir(top, change_os_dir=1) if f.rexists(): actual = f.rfile() - _file_ = open(actual.get_abspath(), "r") + _file_ = open(actual.get_abspath(), "rb") elif f.srcnode().rexists(): actual = f.srcnode().rfile() - _file_ = open(actual.get_abspath(), "r") + _file_ = open(actual.get_abspath(), "rb") elif f.has_src_builder(): # The SConscript file apparently exists in a source # code management system. Build it, but then clear @@ -192,7 +192,7 @@ def _SConscript(fs, *files, **kw): f.built() f.builder_set(None) if f.exists(): - _file_ = open(f.get_abspath(), "r") + _file_ = open(f.get_abspath(), "rb") if _file_: # Chdir to the SConscript directory. Use a path # name relative to the SConstruct file so that if @@ -248,6 +248,7 @@ def _SConscript(fs, *files, **kw): pass try: try: +# _file_ = SCons.Util.to_str(_file_) exec(compile(_file_.read(), _file_.name, 'exec'), call_stack[-1].globals) except SConscriptReturn: -- cgit v0.12