[GRASS-SVN] r68883 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 7 08:21:01 PDT 2016


Author: neteler
Date: 2016-07-07 08:21:01 -0700 (Thu, 07 Jul 2016)
New Revision: 68883

Modified:
   grass/trunk/lib/init/grass.py
Log:
grass.py: fall back to C locale rather than refusing to start at all (see: https://lists.osgeo.org/pipermail/grass-user/2015-April/072331.html)

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2016-07-07 12:10:48 UTC (rev 68882)
+++ grass/trunk/lib/init/grass.py	2016-07-07 15:21:01 UTC (rev 68883)
@@ -1108,10 +1108,12 @@
             # If we get here, system locale settings are terribly wrong
             # There is no point to continue as GRASS/Python will fail
             # in some other unpredictable way.
-            print("System locale is not usable. "
+            print("System locale is not usable (LC_ALL variable not defined). "
                   "It indicates misconfigured environment.")
             print("Reported error message: %s" % e)
-            sys.exit("Fix system locale settings and then try again.")
+            ## TOO DRASTIC: sys.exit("Fix system locale settings and then try again.")
+            locale.setlocale(locale.LC_ALL, 'C')
+            warning(_("Default locale settings are missing. GRASS running with C locale."))
 
         language, encoding = locale.getdefaultlocale()
         if not language:



More information about the grass-commit mailing list