[GRASS-dev] [GRASS GIS] #3734: Location wizard on python 3 seems to be broken

#3734: Location wizard on python 3 seems to be broken
--------------------+-------------------------
Reporter: pmav99 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGUI | Version: svn-trunk
Keywords: | CPU: x86-64
Platform: Linux |
--------------------+-------------------------
I compiled grass gis from source using python 3 and the location wizard
seems to be broken. More specifically clicking on the "New" location
button shows a window with the text:

     Unable to read list: dict_items object has no attribute 'sort'

This is rather typical in python2 code which runs with the python3
interpreter. I checked the source code of
grass/gui/wxpython/location_wizard/wizard.py and fixed that but then the
New button does nothing.

Any suggestions WRT how I could see the full traceback?

BTW, from now on, is python code supposed to be both Python 2 and 3
compatible? Or Python 3 only?

{{{
svn diff
Index: location_wizard/wizard.py

--- location_wizard/wizard.py (revision 73967)
+++ location_wizard/wizard.py (working copy)
@@ -654,7 +654,8 @@
              self.sourceData = data

          try:
- data.sort()
+ data = sorted(data)
+ #data.sort()
              self.DeleteAllItems()
              row = 0
              for value in data:
}}}

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

#3734: Location wizard on python 3 seems to be broken
---------------------+-----------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: location wizard
       CPU: x86-64 | Platform: Linux
---------------------+-----------------------------
Changes (by martinl):

* keywords: => location wizard
* milestone: => 7.8.0

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

#3734: Location wizard on python 3 seems to be broken
---------------------+-----------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: location wizard
       CPU: x86-64 | Platform: Linux
---------------------+-----------------------------

Comment (by annakrat):

Please try r73972.

It should be compatible with Python 2.7 and 3.

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

#3734: Location wizard on python 3 seems to be broken
---------------------+-----------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: location wizard
       CPU: x86-64 | Platform: Linux
---------------------+-----------------------------

Comment (by martinl):

Replying to [ticket:3734 pmav99]:
> BTW, from now on, is python code supposed to be both Python 2 and 3
compatible? Or Python 3 only?

GRASS 7.8 should be Python 2 and 3 compatible. Python3-only release will
be probably GRASS 8.0.

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

#3734: Location wizard on python 3 seems to be broken
---------------------+-----------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.8.0
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords: location wizard
       CPU: x86-64 | Platform: Linux
---------------------+-----------------------------

Comment (by pmav99):

Replying to [comment:2 annakrat]:
> Please try r73972.

I confirm that this is fixed.

BTw, any pointers WRT how could I debug this on my own?

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

#3734: Location wizard on python 3 seems to be broken
---------------------+-----------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.8.0
Component: wxGUI | Version: svn-trunk
Resolution: fixed | Keywords: location wizard
       CPU: x86-64 | Platform: Linux
---------------------+-----------------------------
Changes (by pmav99):

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

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

#3734: Location wizard on python 3 seems to be broken
---------------------+-----------------------------
  Reporter: pmav99 | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.8.0
Component: wxGUI | Version: svn-trunk
Resolution: fixed | Keywords: location wizard
       CPU: x86-64 | Platform: Linux
---------------------+-----------------------------

Comment (by annakrat):

Replying to [comment:4 pmav99]:
> Replying to [comment:2 annakrat]:
> > Please try r73972.
>
> I confirm that this is fixed.
>
> BTw, any pointers WRT how could I debug this on my own?

I ran location wizard from layer manager settings menu and I got the
errors in gui console.

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