summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2015-05-26 12:54:35 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2015-05-26 12:54:35 -0700
commitf6127bd71cb6cc9bc91c495df514a6407e98180c (patch)
tree61e2e52c1229bd4b4b925cd77b0b67b5c9bfcf6e
parentfb4ff4f6ec7683298c4f766d49575d2d041e994c (diff)
parent41cc850fe817c2d9e3a9028e81dea6e259e99295 (diff)
downloadscons-f6127bd71cb6cc9bc91c495df514a6407e98180c.tar.gz
Merged in techtonik/scons (pull request #235)
Fix --tree=all print when build tree contains non-ascii Node representation
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Util.py4
-rw-r--r--test/option--tree.py15
3 files changed, 19 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index ef4e016b..42108de1 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -34,6 +34,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Show --config choices if no argument is specified (PR #202).
- Fixed build crash when XML toolchain isn't installed, and
activated compression for ZIP archives.
+ - Fixed --tree=all print when build tree contains non-ascii
+ Node representation (PR #235).
From Alexandre Feblot:
- Fix for VersionedSharedLibrary under 'sunos' platform.
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 822d5249..6dd64ece 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -264,10 +264,10 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited={}):
children = child_func(root)
if prune and rname in visited and children:
- sys.stdout.write(''.join(tags + margins + ['+-[', rname, ']']) + u'\n')
+ sys.stdout.write(''.join(tags + margins + ['+-[', rname, ']']) + '\n')
return
- sys.stdout.write(''.join(tags + margins + ['+-', rname]) + u'\n')
+ sys.stdout.write(''.join(tags + margins + ['+-', rname]) + '\n')
visited[rname] = 1
diff --git a/test/option--tree.py b/test/option--tree.py
index a50433c0..519ebe32 100644
--- a/test/option--tree.py
+++ b/test/option--tree.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
#
# __COPYRIGHT__
#
@@ -51,6 +52,20 @@ scons: warning: The --debug=tree option is deprecated; please use --tree=all ins
""",
status = 0, match=TestSCons.match_re_dotall)
+
+# Check that printing nodes won't fail with
+# UnicodeDecodeError: 'ascii' codec ... ordinal not in range(128)
+# https://bitbucket.org/scons/scons/pull-request/235
+
+test.write('SConstruct', """\
+# -*- coding: utf-8 -*-
+
+Entry('русский юникод')
+""")
+
+test.run(arguments = '-Q --tree=all')
+
+
test.pass_test()
# Local Variables: