[GRASS-dev] [GRASS GIS] #868: wxGUI: UnicodeEncodeError in Help -> GIS GUI help

#868: wxGUI: UnicodeEncodeError in Help -> GIS GUI help
---------------------+------------------------------------------------------
Reporter: neteler | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------
Trying Help -> GIS GUI help, I got:

{{{
Traceback (most recent call last):
   File "/home/neteler/grass64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/wxgui.py", line 538, in OnAboutGRASS

win = AboutWindow(self)
   File "/home/neteler/grass64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/wxgui.py", line 1669, in __init__

authortxt = wx.StaticText(authorwin, id=wx.ID_ANY,
label=str(authors))
UnicodeEncodeError
:
'ascii' codec can't encode character u'\u571f' in position
91: ordinal not in range(128)
Traceback (most recent call last):
   File "/home/neteler/grass64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/wxgui.py", line 538, in OnAboutGRASS

win = AboutWindow(self)
   File "/home/neteler/grass64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/wxgui.py", line 1669, in __init__

authortxt = wx.StaticText(authorwin, id=wx.ID_ANY,
label=str(authors))
UnicodeEncodeError
:
'ascii' codec can't encode character u'\u571f' in position
91: ordinal not in range(128)
Traceback (most recent call last):
   File "/home/neteler/grass64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/wxgui.py", line 538, in OnAboutGRASS

win = AboutWindow(self)
   File "/home/neteler/grass64/dist.x86_64-unknown-linux-
gnu/etc/wxpython/wxgui.py", line 1669, in __init__

authortxt = wx.StaticText(authorwin, id=wx.ID_ANY,
label=str(authors))
UnicodeEncodeError
:
'ascii' codec can't encode character u'\u571f' in position
91: ordinal not in range(128)
(Wed Jan 13 03:48:45 2010)
g.manual wxGUI
}}}

Closing, opening the GUI solved the problem. Feel free to close if there
is nothing to fix.

Markus

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

#868: wxGUI: UnicodeEncodeError in Help -> GIS GUI help
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
----------------------+-----------------------------------------------------
Comment (by glynn):

Replying to [ticket:868 neteler]:
Trying Help -> GIS GUI help, I got:

{{{
authortxt = wx.StaticText(authorwin, id=wx.ID_ANY, label=str(authors))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u571f' in
position 91: ordinal not in range(128)
(Wed Jan 13 03:48:45 2010)
g.manual wxGUI
}}}

The error refers to the code which is run for Help -> About GRASS GIS
(OnAboutGRASS()), while "g.manual wxGUI" is run for Help -> GRASS GIS GUI
help.

I'm guessing that the error relates to #860, but you only noticed it later
(when the GUI switched to the command output tab for g.manual.

Did you try adding a Japanese name to AUTHORS? If so, that's likely to
fail due to str(authors) (which is bogus; you can (and should) pass Python
unicode() objects to wxPython; there isn't any reason to convert to a
str()).

Fixed in 7.0 with r40408. 6.4 is quite different (most of the help stuff
has been moved from wxgui.py to gui_modules/help.py).

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

#868: wxGUI: UnicodeEncodeError in Help -> GIS GUI help
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-64
----------------------+-----------------------------------------------------
Changes (by neteler):

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

Comment:

Replying to [comment:1 glynn]:
> Replying to [ticket:868 neteler]:
> Trying Help -> GIS GUI help, I got:
>
> {{{
> authortxt = wx.StaticText(authorwin, id=wx.ID_ANY, label=str(authors))
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u571f' in
position 91: ordinal not in range(128)
> (Wed Jan 13 03:48:45 2010)
> g.manual wxGUI
> }}}
>
> The error refers to the code which is run for Help -> About GRASS GIS
(OnAboutGRASS()), while "g.manual wxGUI" is run for Help -> GRASS GIS GUI
help.

Sorry for the confusion.

> I'm guessing that the error relates to #860, but you only noticed it
later (when the GUI switched to the command output tab for g.manual.
>
> Did you try adding a Japanese name to AUTHORS?

After applying your fix to 6.4, I could read the file again in wxGUI and
found

{{{
$Date: 2010-01-09 05:20:30 +0100 (土, 09 1月 2010) $
}}}

So the locale influences the SVN Date tag. Interesting.

> If so, that's likely to fail due to str(authors) (which is bogus; you
can (and should) pass Python unicode() objects to wxPython; there isn't
any reason to convert to a str()).
>
> Fixed in 7.0 with r40408. 6.4 is quite different (most of the help stuff
has been moved from wxgui.py to gui_modules/help.py).

Fixed in r40409 (6.4) and r40410 (6.5).

Markus

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