Opened 8 years ago
Closed 8 years ago
#3340 closed defect (fixed)
wxGUI: encoding error when saving a workspace with vector that has accents in legend_label
Reported by: | mlennert | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.2 |
Component: | wxGUI | Version: | svn-trunk |
Keywords: | legend_label workspace | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Whenever I have a vector map with a legend_label with accents, such as:
d.vect map=roadsmajor@PERMANENT type=point,line,boundary,area,face width=1 legend_label=Chaussées
I cannot save the workspace file because of an encoding error:
Échec d'écriture des paramètres de l'espace de travail courant. Raison: 'ascii' codec can't encode character u'\xe9' in position 33: ordinal not in range(128) Traceback (most recent call last): File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/gui/wxpython/lmgr/frame.py", line 1649, in SaveToWorkspaceFile WriteWorkspaceFile(lmgr=self, file=tmpfile) File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/gui/wxpython/core/workspace.py", line 900, in __init__ self.__writeLayer(mapTree, item) File "/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-gnu/gui/wxpython/core/workspace.py", line 993, in __writeLayer (' ' * self.indent, self.__filterValue(val))) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 33: ordinal not in range(128)
Attachments (1)
Change History (11)
follow-up: 3 comment:1 by , 8 years ago
comment:2 by , 8 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
follow-ups: 4 7 comment:3 by , 8 years ago
comment:4 by , 8 years ago
Replying to mlennert:
Works great. Thanks for the quick fix !
Sort of. Related issue seems to be #3275 I tested various text elements and managed to save workspace just fine, still loading fails, although the error might come form a different area (I'll attach file for testing):
Traceback (most recent call last): File "dist.x86_64-pc-linux-gnu/gui/wxpython/lmgr/frame.py", line 1362, in OnWorkspaceOpen self.LoadWorkspaceFile(filename) File "dist.x86_64-pc-linux-gnu/gui/wxpython/lmgr/frame.py", line 1512, in LoadWorkspaceFile mapdisplay[i].AddBarscale(overlay['cmd']) File "dist.x86_64-pc-linux-gnu/gui/wxpython/mapdisp/frame.py", line 1224, in AddBarscale cmd, completed=(self.GetOptData, None, None)) File "dist.x86_64-pc-linux-gnu/gui/wxpython/gui_core/forms.py", line 2890, in ParseCommand get_dcmd=get_dcmd, layer=layer) File "dist.x86_64-pc-linux-gnu/gui/wxpython/gui_core/forms.py", line 534, in __init__ frame=self) File "dist.x86_64-pc-linux-gnu/gui/wxpython/gui_core/forms.py", line 1313, in __init__ win.SetValue(str(value)) UnicodeEncodeError : 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)
comment:6 by , 8 years ago
follow-up: 8 comment:7 by , 8 years ago
Replying to mlennert:
Replying to annakrat:
In 70979:
Works great. Thanks for the quick fix !
You changed the milestone to 7.2.2. I had the feeling that this is a quite small and pretty non-invasive fix of a standard bug. Don't you think it could still go into 7.2.1 ?
Too close right now, I wouldn't be comfortable doing that especially because I haven't tested it on Windows.
comment:8 by , 8 years ago
Replying to annakrat:
Replying to mlennert:
Replying to annakrat:
In 70979:
Works great. Thanks for the quick fix !
You changed the milestone to 7.2.2. I had the feeling that this is a quite small and pretty non-invasive fix of a standard bug. Don't you think it could still go into 7.2.1 ?
Too close right now, I wouldn't be comfortable doing that especially because I haven't tested it on Windows.
Ok. I agree. So we'll leave this open as a reminder for backport.
comment:9 by , 8 years ago
Is there some documentation about best practices in GUI programming concerning handling of encoding ?
In 70979: