Opened 9 years ago
Closed 9 years ago
#2826 closed defect (fixed)
wxGUI: encoding issues
Reported by: | mlennert | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.0.3 |
Component: | wxGUI | Version: | 7.0.2 |
Keywords: | encoding | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
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.
Change History (7)
comment:2 by , 9 years ago
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.
follow-up: 4 comment:3 by , 9 years ago
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 ?
follow-up: 5 comment:4 by , 9 years ago
Replying to 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.
comment:5 by , 9 years ago
Replying to annakrat:
Replying to 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.
Others found: