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

GRASS GIS trac at osgeo.org
Thu Jan 17 13:13:27 PST 2019


#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>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list