Explorar el Código

temporal: encode mapset string to avoid injecting unicode into temporal library, see https://trac.osgeo.org/grass/ticket/3392

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71423 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová hace 7 años
padre
commit
da664b0502

+ 1 - 1
temporal/t.info/t.info.py

@@ -99,7 +99,7 @@ def main():
     if name.find("@") >= 0:
         id_ = name
     else:
-        id_ = name + "@" + grass.gisenv()["MAPSET"]
+        id_ = name + "@" + grass.encode(grass.gisenv()["MAPSET"])
 
     dataset = tgis.dataset_factory(type_, id_)
 

+ 1 - 1
temporal/t.merge/t.merge.py

@@ -52,7 +52,7 @@ def main():
     tgis.init()
 
     #Get the current mapset to create the id of the space time dataset
-    mapset = grass.gisenv()["MAPSET"]
+    mapset = grass.encode(grass.gisenv()["MAPSET"])
 
     inputs_split = inputs.split(",")
     input_ids = []

+ 1 - 1
temporal/t.rast.gapfill/t.rast.gapfill.py

@@ -82,7 +82,7 @@ def main():
     nprocs = options["nprocs"]
     tsuffix = options["suffix"]
 
-    mapset = grass.gisenv()["MAPSET"]
+    mapset = grass.encode(grass.gisenv()["MAPSET"])
 
     # Make sure the temporal database exists
     tgis.init()

+ 1 - 1
temporal/t.rast.series/t.rast.series.py

@@ -120,7 +120,7 @@ def main():
             if output.find("@") >= 0:
                 id = output
             else:
-                mapset = grass.gisenv()["MAPSET"]
+                mapset = grass.encode(grass.gisenv()["MAPSET"])
                 id = output + "@" + mapset
 
             map = sp.get_new_map_instance(id)

+ 1 - 1
temporal/t.rast.to.rast3/t.rast.to.rast3.py

@@ -50,7 +50,7 @@ def main():
     # Make sure the temporal database exists
     tgis.init()
 
-    mapset = grass.gisenv()["MAPSET"]
+    mapset = grass.encode(grass.gisenv()["MAPSET"])
 
     sp = tgis.open_old_stds(input, "strds")
 

+ 1 - 1
temporal/t.rename/t.rename.py

@@ -51,7 +51,7 @@ def main():
     tgis.init()
 
     #Get the current mapset to create the id of the space time dataset
-    mapset = grass.gisenv()["MAPSET"]
+    mapset = grass.encode(grass.gisenv()["MAPSET"])
 
     if input.find("@") >= 0:
         old_id = input

+ 1 - 1
temporal/t.unregister/t.unregister.py

@@ -67,7 +67,7 @@ def main():
     if not maps and not file:
         grass.fatal(_("%s= or %s= must be specified") % ("input", "file"))
 
-    mapset = grass.gisenv()["MAPSET"]
+    mapset = grass.encode(grass.gisenv()["MAPSET"])
 
     dbif = tgis.SQLDatabaseInterfaceConnection()
     dbif.connect()

+ 1 - 1
temporal/t.vect.observe.strds/t.vect.observe.strds.py

@@ -98,7 +98,7 @@ def main():
     dbif = tgis.SQLDatabaseInterfaceConnection()
     dbif.connect()
 
-    mapset = grass.gisenv()["MAPSET"]
+    mapset = grass.encode(grass.gisenv()["MAPSET"])
 
     out_sp = tgis.check_new_stds(output, "stvds", dbif, overwrite)