Browse Source

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)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68883 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 8 năm trước cách đây
mục cha
commit
8e6b434501
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      lib/init/grass.py

+ 4 - 2
lib/init/grass.py

@@ -1108,10 +1108,12 @@ def set_language(grass_config_dir):
             # 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: