Browse Source

temporal lib: encode all variables resulting from gisenv() (second part of fix for https://trac.osgeo.org/grass/ticket/3392)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71422 15284696-431f-4ddb-bdfa-cd5b030d7da7
Moritz Lennert 7 years ago
parent
commit
15ccb4cda3
1 changed files with 7 additions and 7 deletions
  1. 7 7
      lib/python/temporal/core.py

+ 7 - 7
lib/python/temporal/core.py

@@ -542,9 +542,9 @@ def init(raise_fatal_error=False):
     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 @@ def init(raise_fatal_error=False):
 
     # 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")