From 6bcf7a465f58717c90448825e27134839ef1d991 Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Tue, 8 Jun 2010 21:07:14 -0700
Subject: [PATCH] setup: show-tool-versions.py: print out the output from the
 unix command "locale" and re-arrange encoding data a little bit

---
 misc/build_helpers/show-tool-versions.py | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/misc/build_helpers/show-tool-versions.py b/misc/build_helpers/show-tool-versions.py
index 981f606b..8b0ffc2b 100644
--- a/misc/build_helpers/show-tool-versions.py
+++ b/misc/build_helpers/show-tool-versions.py
@@ -15,9 +15,24 @@ def print_platform():
          pass
 
 def print_python_ver():
+    print
     print "python:", sys.version.replace("\n", " "),
     print ', maxunicode: ' + str(sys.maxunicode),
-    print ', stdout.encoding: ' + str(sys.stdout.encoding),
+
+def print_locale():
+    cmdlist = ['locale']
+    try:
+        res = subprocess.Popen(cmdlist, stdin=open(os.devnull),
+                               stdout=subprocess.PIPE).communicate()[0]
+        print
+        print "locale: ", res.replace("\n", " ")
+    except EnvironmentError, le:
+        sys.stderr.write("Got exception invoking '%s': %s\n" % (cmdlist[0], le,))
+        pass
+
+def print_python_encoding_settings():
+    print
+    print 'stdout.encoding: ' + str(sys.stdout.encoding),
     print ', stdin.encoding: ' + str(sys.stdin.encoding),
     print ', filesystem.encoding: ' + str(sys.getfilesystemencoding()),
     print ', locale.getpreferredencoding: ' + str(locale.getpreferredencoding()),
@@ -79,6 +94,9 @@ print_platform()
 
 print_python_ver()
 
+print_locale()
+print_python_encoding_settings()
+
 print_cmd_ver(['buildbot', '--version'])
 print_cmd_ver(['cl'])
 print_cmd_ver(['gcc', '--version'])
-- 
2.45.2