[GRASS-SVN] r71422 - grass/trunk/lib/python/temporal

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 20 06:35:51 PDT 2017


Author: mlennert
Date: 2017-08-20 06:35:51 -0700 (Sun, 20 Aug 2017)
New Revision: 71422

Modified:
   grass/trunk/lib/python/temporal/core.py
Log:
temporal lib: encode all variables resulting from gisenv() (second part of fix for #3392)


Modified: grass/trunk/lib/python/temporal/core.py
===================================================================
--- grass/trunk/lib/python/temporal/core.py	2017-08-19 21:47:07 UTC (rev 71421)
+++ grass/trunk/lib/python/temporal/core.py	2017-08-20 13:35:51 UTC (rev 71422)
@@ -542,9 +542,9 @@
     grassenv = gscript.gisenv()
 
     # Set the global variable for faster access
-    current_mapset = grassenv["MAPSET"]
-    current_location = grassenv["LOCATION_NAME"]
-    current_gisdbase = grassenv["GISDBASE"]
+    current_mapset = gscript.encode(grassenv["MAPSET"])
+    current_location = gscript.encode(grassenv["LOCATION_NAME"])
+    current_gisdbase = gscript.encode(grassenv["GISDBASE"])
 
     # Check environment variable GRASS_TGIS_RAISE_ON_ERROR
     if os.getenv("GRASS_TGIS_RAISE_ON_ERROR") == "True" or \
@@ -570,14 +570,14 @@
 
     # Set the mapset check and the timestamp write
     if "TGIS_DISABLE_MAPSET_CHECK" in grassenv:
-        if grassenv["TGIS_DISABLE_MAPSET_CHECK"] == "True" or \
-           grassenv["TGIS_DISABLE_MAPSET_CHECK"] == "1":
+        if gscript.encode(grassenv["TGIS_DISABLE_MAPSET_CHECK"]) == "True" or \
+           gscript.encode(grassenv["TGIS_DISABLE_MAPSET_CHECK"]) == "1":
             enable_mapset_check = False
             msgr.warning("TGIS_DISABLE_MAPSET_CHECK is True")
 
     if "TGIS_DISABLE_TIMESTAMP_WRITE" in grassenv:
-        if grassenv["TGIS_DISABLE_TIMESTAMP_WRITE"] == "True" or \
-           grassenv["TGIS_DISABLE_TIMESTAMP_WRITE"] == "1":
+        if gscript.encode(grassenv["TGIS_DISABLE_TIMESTAMP_WRITE"]) == "True" or \
+           gscript.encode(grassenv["TGIS_DISABLE_TIMESTAMP_WRITE"]) == "1":
             enable_timestamp_write = False
             msgr.warning("TGIS_DISABLE_TIMESTAMP_WRITE is True")
 



More information about the grass-commit mailing list