setup: show-tool-versions.py: print out the output from the unix command "locale" and re-arrange encoding data a little bit

This commit is contained in:
Zooko O'Whielacronx 2010-06-08 21:07:14 -07:00
parent 73689bbfd3
commit 6bcf7a465f

View File

@ -15,9 +15,24 @@ def print_platform():
pass pass
def print_python_ver(): def print_python_ver():
print
print "python:", sys.version.replace("\n", " "), print "python:", sys.version.replace("\n", " "),
print ', maxunicode: ' + str(sys.maxunicode), 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 ', stdin.encoding: ' + str(sys.stdin.encoding),
print ', filesystem.encoding: ' + str(sys.getfilesystemencoding()), print ', filesystem.encoding: ' + str(sys.getfilesystemencoding()),
print ', locale.getpreferredencoding: ' + str(locale.getpreferredencoding()), print ', locale.getpreferredencoding: ' + str(locale.getpreferredencoding()),
@ -79,6 +94,9 @@ print_platform()
print_python_ver() print_python_ver()
print_locale()
print_python_encoding_settings()
print_cmd_ver(['buildbot', '--version']) print_cmd_ver(['buildbot', '--version'])
print_cmd_ver(['cl']) print_cmd_ver(['cl'])
print_cmd_ver(['gcc', '--version']) print_cmd_ver(['gcc', '--version'])