setup: catch and log ValueError from locale.getdefaultlocale() in show-tool-versions.py

I got a bug report from Mathias Baert showing that locale.getdefaultlocale() raises an exception on his Mac OS X system. Heh.
This commit is contained in:
Zooko O'Whielacronx 2010-10-14 22:44:40 -07:00
parent 9c01fdeb37
commit 5c31a7079b

View File

@ -31,7 +31,10 @@ def print_python_encoding_settings():
print 'filesystem.encoding: ' + str(sys.getfilesystemencoding())
print 'locale.getpreferredencoding: ' + str(locale.getpreferredencoding())
print 'os.path.supports_unicode_filenames: ' + str(os.path.supports_unicode_filenames)
print 'locale.defaultlocale: ' + str(locale.getdefaultlocale())
try:
print 'locale.defaultlocale: ' + str(locale.getdefaultlocale())
except ValueError, e:
print 'got exception from locale.getdefaultlocale(): ', e
print 'locale.locale: ' + str(locale.getlocale())
def print_stdout(cmdlist, label=None):