Browse Source

wxGUI: encode message only if locales are defined
(merge https://trac.osgeo.org/grass/changeset/41349 from relbr64)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41351 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 15 years ago
parent
commit
e37bebd426
1 changed files with 6 additions and 2 deletions
  1. 6 2
      gui/wxpython/gui_modules/gcmd.py

+ 6 - 2
gui/wxpython/gui_modules/gcmd.py

@@ -442,8 +442,12 @@ class Command:
 
         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):