[GRASS-dev] [GRASS GIS] #2995: wxGUI start fails with charmap codec can't decode byte from g.version

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------------------------------+-------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-
Keywords: g.version, version, packaging, | releasebranch70
  wxGUI, compilation, locales, encoding | CPU: x86-32
Platform: MSWindows 8 |
-------------------------------------------------+-------------------------
The main GUI (g.gui) in 7.0.4RC1 32bit fails to start because of non-ascii
characters in `g.version -rge`, namely in `libgis_date` entry which is
`"2015-12-24 16:07:44 +0100 (Ä?t, 24 12 2015) "` (I assume "Út", i.e. date
with locales instead of some ASCII). The tested computer has some US
locales.

Perhaps wxGUI should deal with that by some different handling (I don't
know what `charmap` is and how computes encoding influences that) or by
ignoring all errors and not showing the version (but maybe the version is
needed also elsewhere).

7.1 (trunk) works.

{{{
Traceback (most recent call last):
   File "C:\Program Files (x86)\GRASS GIS 7.0.4RC1\gui\wxpython\wxgui.py",
line 1
48, in <module>
     sys.exit(main())
   File "C:\Program Files (x86)\GRASS GIS 7.0.4RC1\gui\wxpython\wxgui.py",
line 1
35, in main
     app = GMApp(workspaceFile)
   File "C:\Program Files (x86)\GRASS GIS 7.0.4RC1\gui\wxpython\wxgui.py",
line 5
0, in __init__
     wx.App.__init__(self, False)
   File "C:\Program Files (x86)\GRASS GIS 7.0.4RC1\Python27\lib\site-
packages\wx-
2.8-msw-unicode\wx\_core.py", line 7981, in __init__
     self._BootstrapApp()
   File "C:\Program Files (x86)\GRASS GIS 7.0.4RC1\Python27\lib\site-
packages\wx-
2.8-msw-unicode\wx\_core.py", line 7555, in _BootstrapApp
     return _core_.PyApp__BootstrapApp(*args, **kwargs)
   File "C:\Program Files (x86)\GRASS GIS 7.0.4RC1\gui\wxpython\wxgui.py",
line 8
4, in OnInit
     workspace=self.workspaceFile)
   File "C:\Program Files (x86)\GRASS GIS
7.0.4RC1\gui\wxpython\lmgr\frame.py", l
ine 93, in __init__
     grassVersion = grass.version()['version']
   File "C:\Program Files (x86)\GRASS GIS
7.0.4RC1\etc\python\grass\script\core.p
y", line 1502, in version
     data = parse_command('g.version', flags='rge', errors='ignore')
   File "C:\Program Files (x86)\GRASS GIS
7.0.4RC1\etc\python\grass\script\core.p
y", line 488, in parse_command
     return parse(res, **parse_args)
   File "C:\Program Files (x86)\GRASS GIS
7.0.4RC1\etc\python\grass\script\utils.
py", line 218, in parse_key_val
     v = decode(kv[1].strip())
   File "C:\Program Files (x86)\GRASS GIS
7.0.4RC1\etc\python\grass\script\utils.
py", line 160, in decode
     return string.decode(enc)
   File "C:\Program Files (x86)\GRASS GIS
7.0.4RC1\Python27\lib\encodings\cp1252.
py", line 15, in decode
     return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 29:
  character maps to <undefined>
}}}

{{{
> g.version -rge

version=7.0.4RC1
date=2016
revision=68279
build_date=2016-04-19
build_platform=i386-w64-mingw32
libgis_revision=67364
libgis_date="2015-12-24 16:07:44 +0100 (Ä?t, 24 12 2015) "
proj4=4.9.2
gdal=2.0.2
geos=3.5.0
sqlite=3.7.17
}}}

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

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-releasebranch70
Resolution: | Keywords: g.version, version, packaging,
                         | wxGUI, compilation, locales, encoding
       CPU: x86-32 | Platform: MSWindows 8
-------------------------+-------------------------------------------------

Comment (by martinl):

Right, `gis.h` is wrongly checkouted with Czech locales. I fixed that.
Strangely on the same computer I am getting with `g.version`

{{{
libgis_date="2015-12-24 16:07:44 +0100 (Thu, 24 Dec 2015) "
}}}

I will create new package for testing.

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

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-releasebranch70
Resolution: | Keywords: g.version, version, packaging,
                         | wxGUI, compilation, locales, encoding
       CPU: x86-32 | Platform: MSWindows 8
-------------------------+-------------------------------------------------

Comment (by martinl):

Can you try
https://grass.osgeo.org/grass70/binary/mswindows/native/x86_64/WinGRASS-7.0.4RC1-2
-Setup-x86_64.exe?

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

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-releasebranch70
Resolution: | Keywords: g.version, version, packaging,
                         | wxGUI, compilation, locales, encoding
       CPU: x86-32 | Platform: MSWindows 8
-------------------------+-------------------------------------------------

Comment (by martinl):

or
https://grass.osgeo.org/grass70/binary/mswindows/native/x86/WinGRASS-7.0.4RC1-2-Setup-x86.exe

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

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-releasebranch70
Resolution: fixed | Keywords: g.version, version, packaging,
                         | wxGUI, compilation, locales, encoding
       CPU: x86-32 | Platform: MSWindows 8
-------------------------+-------------------------------------------------
Changes (by wenzeslaus):

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

Comment:

Thanks. Both 32 and 64bit builds of RC2 are working now. I'm closing this
as fixed, although there is still the question about how to handle the
encoding properly but there is probably no simple way on MS Win since the
text was written in Windows-1250 encoding but the reading was done with
Windows-1252 encoding.

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

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-releasebranch70
Resolution: fixed | Keywords: g.version, version, packaging,
                         | wxGUI, compilation, locales, encoding
       CPU: x86-32 | Platform: MSWindows 8
-------------------------+-------------------------------------------------

Comment (by martinl):

I have also updated https://grass.osgeo.org/news/55/15/GRASS-
GIS-7-0-4RC1-released/

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

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-releasebranch70
Resolution: fixed | Keywords: g.version, version, packaging,
                         | wxGUI, compilation, locales, encoding
       CPU: x86-32 | Platform: MSWindows 8
-------------------------+-------------------------------------------------

Comment (by hellik):

From another ticket
{{{
Are you sure you have the latest version? See #2995.
Oh I see, but it's the installer version linked on the download website
which I get in my browser.
From here https://grass.osgeo.org/download/software/ms-windows/
I get this link
https://grass.osgeo.org/grass70/binary/mswindows/native/x86_64/WinGRASS-7.0.4RC1-1
-Setup-x86_64.exe}}}

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

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: reopened
  Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-releasebranch70
Resolution: | Keywords: g.version, version, packaging,
                         | wxGUI, compilation, locales, encoding
       CPU: x86-32 | Platform: MSWindows 8
-------------------------+-------------------------------------------------
Changes (by wenzeslaus):

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

Comment:

The announcement was updated with RC1-2 build but not the download page
(see #3003). I think the download page should still have 7.0.3 at this
point, i.e. it should not have release candidates (except for some extreme
cases).

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

#2995: wxGUI start fails with charmap codec can't decode byte from g.version
-------------------------+-------------------------------------------------
  Reporter: wenzeslaus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.0.4
Component: wxGUI | Version: svn-releasebranch70
Resolution: fixed | Keywords: g.version, version, packaging,
                         | wxGUI, compilation, locales, encoding
       CPU: x86-32 | Platform: MSWindows 8
-------------------------+-------------------------------------------------
Changes (by wenzeslaus):

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

Comment:

Fixed (see #3003).

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