[GRASS-SVN] r68885 - grass/branches/releasebranch_7_0/lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 7 08:27:11 PDT 2016
Author: neteler
Date: 2016-07-07 08:27:11 -0700 (Thu, 07 Jul 2016)
New Revision: 68885
Modified:
grass/branches/releasebranch_7_0/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 + https://lists.osgeo.org/pipermail/grass-user/2016-July/074488.html) (trunk, r68883)
Modified: grass/branches/releasebranch_7_0/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/init/grass.py 2016-07-07 15:26:54 UTC (rev 68884)
+++ grass/branches/releasebranch_7_0/lib/init/grass.py 2016-07-07 15:27:11 UTC (rev 68885)
@@ -802,10 +802,13 @@
# 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. It indicates misconfigured environment."
- print "Reported error message: %s" % e
- sys.exit("Fix system locale settings and then try again.")
-
+ print("System locale is not usable (LC_ALL variable not defined). "
+ "It indicates misconfigured environment.")
+ print("Reported error message: %s" % e)
+ ## 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:
warning(_("Default locale settings are missing. GRASS running with C locale."))
More information about the grass-commit
mailing list