# HG changeset patch # User Pascal Volk # Date 1252546946 0 # Node ID 3dbee02711cd947ab31aaebef5a7f08cf4f2fc62 # Parent 350488efe67ddcfcfd279c9f1aff44d0ab17506a Ignore unsupported locale setting and silently fall back to 'C'. diff -r 350488efe67d -r 3dbee02711cd VirtualMailManager/__init__.py --- a/VirtualMailManager/__init__.py Wed Sep 09 07:13:20 2009 +0000 +++ b/VirtualMailManager/__init__.py Thu Sep 10 01:42:26 2009 +0000 @@ -11,9 +11,12 @@ from constants.VERSION import * import constants.ERROR as ERR -# Set all of the locales according to the current environment variables -# and get the character encoding. -locale.setlocale(locale.LC_ALL, '') +# Try to set all of the locales according to the current +# environment variables and get the character encoding. +try: + locale.setlocale(locale.LC_ALL, '') +except locale.Error: + locale.setlocale(locale.LC_ALL, 'C') ENCODING = locale.nl_langinfo(locale.CODESET) def w_std(*args):