[GRASS-dev] [GRASS GIS] #2826: wxGUI: encoding issues

#2826: wxGUI: encoding issues
-------------------------+-------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: 7.0.2
Keywords: encoding | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
I'm getting bitten by quite a lot of encoding issues in the wxGUI lately.
I'm putting them here into one bug report as they all seem to have a
similar pattern, but I can split up into separate bug reports if
necessary.

Here are two examples using freshly checked out trunk (but I can reproduce
in grass70_release and in grass 7.0.2 - all with locale fr_BE.utf8):

* v.to.rast/r.to.vect: just launching the module makes three error windows
pop up with "'ascii' codec can't decode byte 0xc3 in position 8: ordinal
not in range(128)". After clicking through the three messages, I can
launch the command. In the console I get:

{{{
Traceback (most recent call last):
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64
-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line
2267, in OnSetValue

self.OnUpdateValues(event)
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64
-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line
629, in updateValuesHook

self.SetStatusText(' '.join(map(gcmd.DecodeString,
self.notebookpanel.createCmd(ignoreErrors = True))))
TypeError
:
argument 2 to map() must support iteration
Traceback (most recent call last):
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64
-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line
2267, in OnSetValue

self.OnUpdateValues(event)
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64
-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line
629, in updateValuesHook

self.SetStatusText(' '.join(map(gcmd.DecodeString,
self.notebookpanel.createCmd(ignoreErrors = True))))
TypeError
:
argument 2 to map() must support iteration
Traceback (most recent call last):
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64
-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line
2094, in OnUpdateDialog

self.parent.updateValuesHook()
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64
-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line
629, in updateValuesHook

self.SetStatusText(' '.join(map(gcmd.DecodeString,
self.notebookpanel.createCmd(ignoreErrors = True))))
TypeError
:
argument 2 to map() must support iteration
}}}

* d.rgb: same error pop-up, just once, same error message in console (see
below). However, when I choose a raster band I get the same pop-up window
which is blocked from view by the layer list selector and so I cannot
click on the 'OK' button. Any GUI programme I have open is then completely
blocked, only terminal is accessible allowing me to kill the process. This
basically makes d.rgb unusable for me in the wxGUI.

{{{
Traceback (most recent call last):
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64
-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line
2094, in OnUpdateDialog

self.parent.updateValuesHook()
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64
-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line
629, in updateValuesHook

self.SetStatusText(' '.join(map(gcmd.DecodeString,
self.notebookpanel.createCmd(ignoreErrors = True))))
TypeError
:
argument 2 to map() must support iteration
}}}

I'll add others if I stumble upon them.

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

#2826: wxGUI: encoding issues
--------------------------+-------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: 7.0.2
Resolution: | Keywords: encoding
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by mlennert):

Found another: v.buffer

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

#2826: wxGUI: encoding issues
--------------------------+-------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: 7.0.2
Resolution: | Keywords: encoding
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by mlennert):

This seems to be fixed by r67187.

For me this can be backported to releasebranch, but probably also needs
some testing on Windows, so leaving the ticket open for now.

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

#2826: wxGUI: encoding issues
--------------------------+-------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: 7.0.2
Resolution: | Keywords: encoding
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by mlennert):

Just one question coming from my ignorance of the wxgui code logic: the
fact that r67187 hardcodes utf-8 is because this is the encoding used
internally by the routines ?

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

#2826: wxGUI: encoding issues
--------------------------+-------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: 7.0.2
Resolution: | Keywords: encoding
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by annakrat):

Replying to [comment:3 mlennert]:
> Just one question coming from my ignorance of the wxgui code logic: the
fact that r67187 hardcodes utf-8 is because this is the encoding used
internally by the routines ?

The XML tree is converted to utf-8 before that. Not sure why is that. But
as I said, I would like to test it on Windows to make sure I understand it
correctly.

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

#2826: wxGUI: encoding issues
--------------------------+-------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: 7.0.2
Resolution: | Keywords: encoding
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by annakrat):

Replying to [comment:4 annakrat]:
> Replying to [comment:3 mlennert]:
> > Just one question coming from my ignorance of the wxgui code logic:
the fact that r67187 hardcodes utf-8 is because this is the encoding used
internally by the routines ?
>
> The XML tree is converted to utf-8 before that. Not sure why is that.
But as I said, I would like to test it on Windows to make sure I
understand it correctly.

I got confused, updated in r67262, tested on Windows.

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

#2826: wxGUI: encoding issues
--------------------------+-------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: 7.0.2
Resolution: | Keywords: encoding
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by mlennert):

This should be backported to release70.

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

#2826: wxGUI: encoding issues
--------------------------+-------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.3
Component: wxGUI | Version: 7.0.2
Resolution: fixed | Keywords: encoding
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by annakrat):

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

Comment:

Already done, see #2827.

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