[GRASS-SVN] r51372 - grass/branches/develbranch_6/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 11 05:10:13 EDT 2012


Author: martinl
Date: 2012-04-11 02:10:13 -0700 (Wed, 11 Apr 2012)
New Revision: 51372

Modified:
   grass/branches/develbranch_6/gui/wxpython/core/gcmd.py
Log:
wxGUI: don't fail when locale is invalid 


Modified: grass/branches/develbranch_6/gui/wxpython/core/gcmd.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/gcmd.py	2012-04-11 09:06:28 UTC (rev 51371)
+++ grass/branches/develbranch_6/gui/wxpython/core/gcmd.py	2012-04-11 09:10:13 UTC (rev 51372)
@@ -73,8 +73,13 @@
     """
     if not string:
         return string
+
+    try:
+        enc = locale.getdefaultlocale()[1]
+    except ValueError, e:
+        sys.stderr.write(_("ERROR: %s\n") % str(e))
+        return string
     
-    enc = locale.getdefaultlocale()[1]
     if enc:
         Debug.msg(5, "DecodeString(): enc=%s" % enc)
         return string.decode(enc)



More information about the grass-commit mailing list