[GRASS-SVN] r68705 - in grass/branches/releasebranch_7_2/gui/wxpython: . core

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 17 04:17:14 PDT 2016


Author: martinl
Date: 2016-06-17 04:17:14 -0700 (Fri, 17 Jun 2016)
New Revision: 68705

Modified:
   grass/branches/releasebranch_7_2/gui/wxpython/core/utils.py
   grass/branches/releasebranch_7_2/gui/wxpython/gis_set.py
Log:
wxGUI: catch also UnicodeDecodeError when reading current directory as GISDBASE (merge r68704 from trunk)

Modified: grass/branches/releasebranch_7_2/gui/wxpython/core/utils.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/core/utils.py	2016-06-17 11:14:41 UTC (rev 68704)
+++ grass/branches/releasebranch_7_2/gui/wxpython/core/utils.py	2016-06-17 11:17:14 UTC (rev 68705)
@@ -614,7 +614,7 @@
                     listOfLocations.append(os.path.basename(location))
             except:
                 pass
-    except UnicodeEncodeError as e:
+    except (UnicodeEncodeError, UnicodeDecodeError) as e:
         raise e
 
     ListSortLower(listOfLocations)

Modified: grass/branches/releasebranch_7_2/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gis_set.py	2016-06-17 11:14:41 UTC (rev 68704)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gis_set.py	2016-06-17 11:17:14 UTC (rev 68705)
@@ -787,10 +787,11 @@
         """Update list of locations"""
         try:
             self.listOfLocations = GetListOfLocations(dbase)
-        except UnicodeEncodeError:
+        except (UnicodeEncodeError, UnicodeDecodeError) as e:
             GError(parent=self,
-                   message=_("Unable to set GRASS database. "
-                             "Check your locale settings."))
+                   message=_("Unicode error detected. "
+                             "Check your locale settings. Details: {}").format(e),
+                   showTraceback=False)
 
         self.lblocations.Clear()
         self.lblocations.InsertItems(self.listOfLocations, 0)



More information about the grass-commit mailing list