[GRASS-dev] [GRASS GIS] #2438: Vect_get_line_type cannot handle line out of range

GRASS GIS trac at osgeo.org
Tue Sep 30 00:48:40 PDT 2014


#2438: Vect_get_line_type cannot handle line out of range
-------------------------+--------------------------------------------------
 Reporter:  artegion     |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  6.4.5                    
Component:  LibVector    |     Version:  unspecified              
 Keywords:               |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------
 calling Vect_get_line_type with line out of range (i.e. line=0)
 Vect_line_alive returns -1 but Vect_get_line_type ignores it (not -1 is
 False just like not 1) -> access violation reading ....

 {{{
 >>> from grass.lib.vector import  Vect_line_alive
 >>> from grass.lib.vector import  Vect_get_line_type
 >>> from grass.pygrass vector import VectorTopo
 >>> a= VectorTopo('test')
 >>> a.open()
 >>> Vect_line_alive(a.c_mapinfo, 1)
 1
 >>> Vect_get_line_type(a.c_mapinfo, 1)
 1
 >>> Vect_line_alive(a.c_mapinfo, 0)
 -1
 >>> not Vect_line_alive(a.c_mapinfo, 0)
 False
 >>> Vect_get_line_type(a.c_mapinfo, 0)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 WindowsError: exception: access violation reading 0x736C0014
 >>>
 }}}

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



More information about the grass-dev mailing list