[GRASS-SVN] r41351 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 8 10:51:07 EST 2010


Author: martinl
Date: 2010-03-08 10:51:07 -0500 (Mon, 08 Mar 2010)
New Revision: 41351

Modified:
   grass/trunk/gui/wxpython/gui_modules/gcmd.py
Log:
wxGUI: encode message only if locales are defined
(merge r41349 from relbr64)


Modified: grass/trunk/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcmd.py	2010-03-08 15:47:00 UTC (rev 41350)
+++ grass/trunk/gui/wxpython/gui_modules/gcmd.py	2010-03-08 15:51:07 UTC (rev 41351)
@@ -442,8 +442,12 @@
 
         for type, msg in self.__ProcessStdErr():
             if type == 'ERROR':
-                return unicode(msg, locale.getdefaultlocale()[1])
-
+                enc = locale.getdefaultlocale()[1]
+                if enc:
+                    return unicode(msg, enc)
+                else:
+                    return msg
+        
         return ''
     
 class CommandThread(Thread):



More information about the grass-commit mailing list