[GRASS-dev] [GRASS GIS] #987: Location wizard choose from EPSG robustness issues

GRASS GIS trac at osgeo.org
Sun Mar 7 03:29:59 EST 2010


#987: Location wizard choose from EPSG robustness issues
-------------------------+--------------------------------------------------
 Reporter:  marisn       |       Owner:  grass-dev at lists.osgeo.org
     Type:  defect       |      Status:  new                      
 Priority:  minor        |   Milestone:  6.4.0                    
Component:  wxGUI        |     Version:  svn-releasebranch64      
 Keywords:               |    Platform:  Linux                    
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------
 Start location wizard -> Select EPSG code -> Path to EPSG codes file
 displays wrong file (that's OK), but I see uncaught exception in console:

 {{{
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1381, in
 OnEnterPage
     self.OnBrowseCodes(None)
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1491, in
 OnBrowseCodes
     f = open(self.tfile.GetValue(), "r")
 IOError: [Errno 2] No such file or directory:
 u'/usr/local/share/proj/epsg'
 }}}
 Can be fixed by something like:

 {{{
 Index: location_wizard.py
 ===================================================================
 --- location_wizard.py  (revision 41315)
 +++ location_wizard.py  (working copy)
 @@ -1488,7 +1488,10 @@
          if True:
              data = []
              self.epsgCodeDict = {}
 -            f = open(self.tfile.GetValue(), "r")
 +            try:
 +                f = open(self.tfile.GetValue(), "r")
 +            except IOError:
 +                return
              i = 0
              code = None
              for line in f.readlines():
 }}}

 Now cancel Location wizard and repeat previous steps: Location wizard ->
 Select EPSG (choice is PRESELECTED) -> NEXT gives Choose by code and not
 EPSG code. WTF?
 Seems like location wizard is not ready to be run more than one time
 during GRASS startup session.

 Now edit path to EPSG code file (i.e. delete "local" from
 "/usr/local/share/proj") -> PATH to epsg is correct, still it's impossible
 to search EPSG code list or press "Next" when correct code is set.
 Location wizard should also check for onChanged event for EPSG code file
 entry.

 Also other EPSG window elements should check for presence of valid EPSG
 code file before issuing any actions:
 {{{
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1381, in
 OnEnterPage
     self.OnBrowseCodes(None)
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1491, in
 OnBrowseCodes
     f = open(self.tfile.GetValue(), "r")
 IOError: [Errno 2] No such file or directory:
 u'/usr/local/share/proj/epsg'
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1447, in OnSearch
     self.epsglist.Search(index=[0,1,2], pattern=value)
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 646, in Search
     for i in range(len(self.sourceData)):
 TypeError: object of type 'NoneType' has no len()
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1447, in OnSearch
     self.epsglist.Search(index=[0,1,2], pattern=value)
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 646, in Search
     for i in range(len(self.sourceData)):
 TypeError: object of type 'NoneType' has no len()
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1447, in OnSearch
     self.epsglist.Search(index=[0,1,2], pattern=value)
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 646, in Search
     for i in range(len(self.sourceData)):
 TypeError: object of type 'NoneType' has no len()
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1447, in OnSearch
     self.epsglist.Search(index=[0,1,2], pattern=value)
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 646, in Search
     for i in range(len(self.sourceData)):
 TypeError: object of type 'NoneType' has no len()
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1447, in OnSearch
     self.epsglist.Search(index=[0,1,2], pattern=value)
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 646, in Search
     for i in range(len(self.sourceData)):
 TypeError: object of type 'NoneType' has no len()
 Traceback (most recent call last):
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1381, in
 OnEnterPage
     self.OnBrowseCodes(None)
   File "/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
 gnu/etc/wxpython/gui_modules/location_wizard.py", line 1491, in
 OnBrowseCodes
     f = open(self.tfile.GetValue(), "r")
 IOError: [Errno 2] No such file or directory:
 u'/usr/local/share/proj/epsg'
 }}}

 Tested with GRASS 6.4 r41315 running dev-python/wxpython-2.8.10.1 on
 ~AMD64 Gentoo.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/987>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list