[GRASS-SVN] r51373 -
grass/branches/releasebranch_6_4/gui/wxpython/core
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Apr 11 05:14:03 EDT 2012
Author: martinl
Date: 2012-04-11 02:14:02 -0700 (Wed, 11 Apr 2012)
New Revision: 51373
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/core/gcmd.py
Log:
wxGUI: don't fail when locale is invalid
(merge r51372 from devbr6)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/core/gcmd.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/core/gcmd.py 2012-04-11 09:10:13 UTC (rev 51372)
+++ grass/branches/releasebranch_6_4/gui/wxpython/core/gcmd.py 2012-04-11 09:14:02 UTC (rev 51373)
@@ -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