瀏覽代碼

wxGUI: fix loading addons (with different locale) which are compiled for different version - use only byte strings

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@66036 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 9 年之前
父節點
當前提交
24cefc9cfc
共有 2 個文件被更改,包括 1 次插入7 次删除
  1. 0 6
      gui/wxpython/core/toolboxes.py
  2. 1 1
      lib/python/script/task.py

+ 0 - 6
gui/wxpython/core/toolboxes.py

@@ -628,12 +628,6 @@ def _loadMetadata(module):
     try:
         task = gtask.parse_interface(module)
     except ScriptError as e:
-        e = _encode_string(e.value)
-        # for some reason this works well only if it is separate
-        sys.stderr.write("%s\n" % module)
-        sys.stderr.write("%s\n" % e)
-        return '', ''
-    except UnicodeDecodeError as e:
         sys.stderr.write("%s\n%s\n" % (module, e))
         return '', ''
 

+ 1 - 1
lib/python/script/task.py

@@ -493,7 +493,7 @@ def get_interface_description(cmd):
 
         if p.returncode != 0:
             raise ScriptError, _("Unable to fetch interface description for command '%(cmd)s'."
-                                 "\n\nDetails: %(det)s") % {'cmd': cmd, 'det': decode(cmderr)}
+                                 "\n\nDetails: %(det)s") % {'cmd': cmd, 'det': cmderr}
 
     except OSError as e:
         raise ScriptError, _("Unable to fetch interface description for command '%(cmd)s'."