[GRASS-dev] [GRASS GIS] #2410: Python ScriptError

GRASS GIS trac at osgeo.org
Sun Sep 7 23:45:16 PDT 2014


#2410: Python ScriptError
-------------------------+--------------------------------------------------
 Reporter:  martinl      |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  7.1.0                    
Component:  Python       |     Version:  svn-trunk                
 Keywords:  ScriptError  |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------
 In trunk Python Scripting Library is used !ScriptError from PyGRASS
 source:grass/trunk/lib/python/script/core.py#L36. It was introduced in
 r61187 by zarch. In relbr70 is still used it's own implementation of
 `ScriptError`
 source:grass/branches/releasebranch_7_0/lib/python/script/core.py#L70
 which defines attribute `value`. This attribute is accessed on many places
 of Python Scripting Library or wxGUI, eg.

 {{{
             except ScriptError as e:
                 self.errorMsg = e.value
 }}}

 Since `ScriptError` from PyGRASS doesn't have this attribute, it fails
 with

 {{{
   File "/opt/src/grass_trunk/dist.x86_64-unknown-linux-
 gnu/etc/python/grass/script/task.py", line 70, in __init__
     self.errorMsg = e.value
 AttributeError: 'ScriptError' object has no attribute 'value'
 }}}

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



More information about the grass-dev mailing list