From 5c31a7079b0e9681872621f27d14339441bc8188 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Thu, 14 Oct 2010 22:44:40 -0700 Subject: [PATCH] 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. --- misc/build_helpers/show-tool-versions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/build_helpers/show-tool-versions.py b/misc/build_helpers/show-tool-versions.py index 19d21084..45b1645b 100644 --- a/misc/build_helpers/show-tool-versions.py +++ b/misc/build_helpers/show-tool-versions.py @@ -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): -- 2.45.2