[GRASS-SVN] r64661 - grass/trunk/gui/wxpython/core
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Feb 17 06:37:57 PST 2015
Author: annakrat
Date: 2015-02-17 06:37:57 -0800 (Tue, 17 Feb 2015)
New Revision: 64661
Modified:
grass/trunk/gui/wxpython/core/toolboxes.py
Log:
wxGUI: attempt to fix loading incompatible addons during startup when the error has non-ascii characters
Modified: grass/trunk/gui/wxpython/core/toolboxes.py
===================================================================
--- grass/trunk/gui/wxpython/core/toolboxes.py 2015-02-17 11:07:23 UTC (rev 64660)
+++ grass/trunk/gui/wxpython/core/toolboxes.py 2015-02-17 14:37:57 UTC (rev 64661)
@@ -32,7 +32,7 @@
from core.globalvar import WXGUIDIR
from core.utils import GetSettingsPath, _
-from core.gcmd import GError, RunCommand
+from core.gcmd import GError, RunCommand, EncodeString
import grass.script.task as gtask
import grass.script.core as gcore
@@ -556,9 +556,15 @@
"""
try:
task = gtask.parse_interface(module)
- except (ScriptError, UnicodeDecodeError) as e:
- sys.stderr.write("%s: %s\n" % (module, e))
+ except ScriptError as e:
+ e = EncodeString(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 '', ''
return task.get_description(full=True), \
task.get_keywords()
More information about the grass-commit
mailing list