From: Zooko O'Whielacronx Date: Wed, 9 Jun 2010 04:07:14 +0000 (-0700) Subject: setup: show-tool-versions.py: print out the output from the unix command "locale... X-Git-Url: https://git.rkrishnan.org/simplejson/%22news.html/somewhere?a=commitdiff_plain;h=6bcf7a465f58717c90448825e27134839ef1d991;p=tahoe-lafs%2Ftahoe-lafs.git setup: show-tool-versions.py: print out the output from the unix command "locale" and re-arrange encoding data a little bit --- 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'])