]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
setup: show-tool-versions.py: print out the output from the unix command "locale...
authorZooko O'Whielacronx <zooko@zooko.com>
Wed, 9 Jun 2010 04:07:14 +0000 (21:07 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Wed, 9 Jun 2010 04:07:14 +0000 (21:07 -0700)
misc/build_helpers/show-tool-versions.py

index 981f606b33f24f82bd7230a55a679a59c7cec000..8b0ffc2b97cbf62b1e5f4b3b427f13dbddb71a9c 100644 (file)
@@ -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'])