[GRASS-dev] [GRASS GIS] #3392: t.register: encoding error

GRASS GIS trac at osgeo.org
Sat Aug 19 10:02:41 PDT 2017


#3392: t.register: encoding error
--------------------------+---------------------------------
  Reporter:  mlennert     |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:  7.2.2
 Component:  Temporal     |    Version:  svn-trunk
Resolution:               |   Keywords:  t.register encoding
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+---------------------------------

Comment (by mlennert):

 Replying to [comment:22 annakrat]:
 > Replying to [comment:21 mlennert]:
 > > Replying to [comment:19 annakrat]:
 > > > I applied that one line to trunk. It needs testing before we
 backport it. This works very likely only with Python 2, not Python 3. For
 that we need to do probably substantial changes, which I haven't looked at
 yet.
 > > >
 > > > I was previously running into more problems, but I can't reproduce
 it now. So please test.
 > >
 > > Just did and I don't understand why, but I again have issues (see
 below), but not the same as before. I'm a bit lost as to why it worked
 before, but not now....
 >
 > I don't understand why it behaved differently, try to apply the rest of
 the patch.

 I guess you mean


 {{{
 Index: lib/python/temporal/core.py
 ===================================================================
 --- lib/python/temporal/core.py (révision 71411)
 +++ lib/python/temporal/core.py (copie de travail)
 @@ -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 \
 }}}

 This solves the issue with t.create and t.register, but not with
 t.unregister:


 {{{
 t.unregister file=rasters_tempmean.list
 Unregister maps
 Traceback (most recent call last):
   File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/scripts/t.unregister", line 183, in <module>
     tgis.profile_function(main)
   File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/etc/python/grass/temporal/core.py", line 84, in profile_function
     func()
   File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/scripts/t.unregister", line 142, in main
     statement += map.delete(dbif=dbif, update=False, execute=False)
   File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/etc/python/grass/temporal/abstract_map_dataset.py", line 860, in
 delete
     "database") % (self.get_type(), self.get_id()))
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 24:
 ordinal not in range(128)
 }}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3392#comment:23>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list