[GRASS-dev] [GRASS GIS] #2011: WxGUI, menu does not work at all (languages using double-byte characters)

#2011: WxGUI, menu does not work at all (languages using double-byte characters)
--------------------------------+-------------------------------------------
Reporter: venkat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.3 RCs
Keywords: encoding, wingrass | Platform: MSWindows 7
      Cpu: Unspecified |
--------------------------------+-------------------------------------------
Testing GRASS6.4.3RC3 on Windows7 and Windows8

Several of WX-Python menu give error as shown below.

For example,

a) start GRASS and display Raster image
b) choose r.colors (or others from raster pull down menu
c) Result is the error shown below

This may be same problem as OSGEO4W Track ticket#1380

Similar problem was fixed in GRASS-6.4.2 but has crept in
again in GRASS-6.4.3RC2, GRASS-6.4.3RC3

-------- error message TO -------
  File "C:\OSGeo4W\apps\grass\grass-6.4.3RC3\etc\wxpython\lm
gr\frame.py", line 541, in GetMenuCmd

input = GUI().GetCommandInputMapParamKey(cmdlist[0])
   File "C:\OSGeo4W\apps\grass\grass-6.4.3RC3\etc\wxpython\gu
i_core\forms.py", line 1970, in GetCommandInputMapParamKey

p = re.compile('encoding="' + enc + '"', re.IGNORECASE)
NameError
:
global name 're' is not defined
-------- error message FROM -------

Best

Venka

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

#2011: WxGUI, menu does not work at all (languages using double-byte characters)
--------------------------------+-------------------------------------------
Reporter: venkat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.3 RCs
Keywords: encoding, wingrass | Platform: MSWindows 7
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by hamish):

"re.*" is the regular expression library, there should be a "import re"
somewhere.

does "import re" work from the python tab in the layer manager? maybe it
isn't being packaged?

Hamish

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

#2011: WxGUI, menu does not work at all (languages using double-byte characters)
-----------------------------------------+----------------------------------
Reporter: venkat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.3 RCs
Keywords: encoding, wingrass, osgeo4w | Platform: MSWindows 7
      Cpu: Unspecified |
-----------------------------------------+----------------------------------
Changes (by hamish):

  * keywords: encoding, wingrass => encoding, wingrass, osgeo4w

Comment:

(ticket is for osgeo4w, not the standalone installer)

for the stand-alone nightly build of 6.4.3svn, re.py is there in
C:\Program Files\GRASS...\Python27\Lib, and imports ok in the python shell
tab of the layer manager. r.colors and the r.colors interactive wrapper
both open ok there.

I'm unable to test multi-byte language Windows, but seeing as the error is
`name 're' is not defined` my first guess is the missing re.py library.

?

Hamish

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

#2011: WxGUI, menu does not work at all (languages using double-byte characters)
-----------------------------------------+----------------------------------
Reporter: venkat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.3 RCs
Keywords: encoding, wingrass, osgeo4w | Platform: MSWindows 7
      Cpu: Unspecified |
-----------------------------------------+----------------------------------

Comment(by hamish):

try opening
C:\OSGeo4W\apps\grass\grass-6.4.3RC3\etc\wxpython\gui_core\forms.py in a
text editor, and adding the line "import re" about line 50 with all the
other import statements.

forms.py uses re.() but never imports it. I guess it is not always a
built-in?

Hamish

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

#2011: WxGUI, menu does not work at all (languages using double-byte characters)
-----------------------------------------+----------------------------------
Reporter: venkat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.3 RCs
Keywords: encoding, wingrass, osgeo4w | Platform: MSWindows 7
      Cpu: Unspecified |
-----------------------------------------+----------------------------------

Comment(by venkat):

"import re" works in the python tab in the layer manager.
In fact, the problem is not only for r.colors but for
all the menu items from the "Raster" pulldown (r.distance,
r.buffer etc.).

Typing the command (r.colors, r,buffer etc.) brings up the
command panel without the error I reported. Problem is when
we select from the pulldown "Raster" menu.

Venka

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

#2011: WxGUI, menu does not work at all (languages using double-byte characters)
-----------------------------------------+----------------------------------
Reporter: venkat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.4
Component: wxGUI | Version: 6.4.3 RCs
Keywords: encoding, wingrass, osgeo4w | Platform: MSWindows 7
      Cpu: Unspecified |
-----------------------------------------+----------------------------------
Changes (by venkat):

  * priority: blocker => critical

Comment:

Added "import re" to forms.py and it worked.

Appropriate change before the next build would
fix this issue.

Thanks

Venka

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

#2011: WxGUI, menu does not work at all (languages using double-byte characters)
--------------------------+-------------------------------------------------
  Reporter: venkat | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 6.4.3
Component: wxGUI | Version: 6.4.3 RCs
Resolution: fixed | Keywords: encoding, wingrass, osgeo4w
  Platform: MSWindows 7 | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by hamish):

  * status: new => closed
  * resolution: => fixed
  * milestone: 6.4.4 => 6.4.3

Comment:

fix applied in devbr6 and relbr64 with r56763,4.
Anna had already taken care of it in trunk.

Hamish

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