[GRASS-dev] [GRASS GIS] #3874: Encode error in g.extension, add-ons not written in GUI

#3874: Encode error in g.extension, add-ons not written in GUI
------------------------+-------------------------
Reporter: veroandreo | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.8.0
Component: Addons | Version: svn-trunk
Keywords: | CPU: x86-64
Platform: Linux |
------------------------+-------------------------
I just compiled grass77 in a colleague's Linux Mint 19.1 Cinamon laptop
following the instructions here:
https://grasswiki.osgeo.org/wiki/Compile_and_Install#Linux_Mint

All is fine, but when we install **any** add-on, we get:
{{{
g.extension r.seasons
Fetching <r.seasons> from GRASS GIS Addons repository (be patient)...
Compiling...
Installing...
Updating addons metadata file...
Updating private addons metadata file...
Traceback (most recent call last):
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 1933, in <module>
     sys.exit(main())
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 1913, in main
     install_extension(source=source, url=url, xmlurl=xmlurl)
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 704, in install_extension
     blist = install_private_extension_xml(tmp_dir, mlist)
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 1006, in install_private_extension_xml
     write_xml_modules(xml_file, tree)
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 603, in write_xml_modules
     (' ' * indent, tnode.find('keywords').text))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in
position 19: ordinal not in range(128)

GRASS 7.7.dev (nc_basic_spm_grass7):~ > g.extension extension=v.class.mlR
Fetching <v.class.mlR> from GRASS GIS Addons repository (be patient)...
Compiling...
Installing...
Updating addons metadata file...
Updating private addons metadata file...
Traceback (most recent call last):
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 1933, in <module>
     sys.exit(main())
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 1913, in main
     install_extension(source=source, url=url, xmlurl=xmlurl)
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 704, in install_extension
     blist = install_private_extension_xml(tmp_dir, mlist)
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 1006, in install_private_extension_xml
     write_xml_modules(xml_file, tree)
   File "/home/carla/software/grass-7.7.git/dist.x86_64-pc-linux-
gnu/scripts/g.extension", line 603, in write_xml_modules
     (' ' * indent, tnode.find('keywords').text))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in
position 29: ordinal not in range(128)
}}}

The add-on is indeed installed, but it is not added to the list of
extensions in the GUI. I cannot reproduce any of this in my Fedora box
with freshly re-compiled grass77 with locale in English.

Locale is in Spanish for Argentina, but there's no special characters in
her user:

{{{
LANG=es_AR
LANGUAGE=es_AR
LC_CTYPE=es_AR.UTF-8
LC_NUMERIC=C
LC_TIME=es_AR.UTF-8
LC_COLLATE=es_AR.UTF-8
LC_MONETARY=es_AR.UTF-8
LC_MESSAGES=es_AR.UTF-8
LC_PAPER=es_AR.UTF-8
LC_NAME=es_AR.UTF-8
LC_ADDRESS=es_AR.UTF-8
LC_TELEPHONE=es_AR.UTF-8
LC_MEASUREMENT=es_AR.UTF-8
LC_IDENTIFICATION=es_AR.UTF-8
LC_ALL=
}}}

System info:

{{{
Versión de GRASS: 7.7.dev
Code revision: fca1b4079
Fecha de compilación: 2019-07-18
Construir plataforma: x86_64-pc-linux-gnu
GDAL: 2.2.3
PROJ.4: 4.9.3
GEOS: 3.6.2
SQLite: 3.22.0
Python: 2.7.15+
wxPython: 3.0.2.0
Plataforma: Linux-4.15.0-54-generic-x86_64-with-LinuxMint-19.1-tessa
}}}

ps: she is also getting an encode/decode error when trying to display a
raster from GUI:

{{{
'ascii' codec can't decode byte 0xc3 in position 17: ordinal not in
range(128)
}}}

however, she accepts the error and the raster is displayed anyway...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3874&gt;
GRASS GIS <https://grass.osgeo.org>

#3874: Encode error in g.extension, add-ons not written in GUI
-------------------------+-------------------------
  Reporter: veroandreo | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.3
Component: Addons | Version: svn-trunk
Resolution: | Keywords:
       CPU: x86-64 | Platform: Linux
-------------------------+-------------------------

Comment (by sbl):

There were changes in g.extension including move to Python 3. Is this
still a relevant issue?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3874#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3874: Encode error in g.extension, add-ons not written in GUI
-------------------------+-------------------------
  Reporter: veroandreo | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.8.3
Component: Addons | Version: svn-trunk
Resolution: fixed | Keywords:
       CPU: x86-64 | Platform: Linux
-------------------------+-------------------------
Changes (by veroandreo):

* status: new => closed
* resolution: => fixed

Comment:

The reported problem is no longer an issue. Closing as fixed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3874#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>