[GRASS-dev] [GRASS GIS] #3211: Pygrass crash when trying to drop DB table

GRASS GIS trac at osgeo.org
Wed Nov 16 13:23:28 PST 2016


#3211: Pygrass crash when trying to drop DB table
---------------------+---------------------------------
 Reporter:  lrntct   |      Owner:  grass-dev@…
     Type:  defect   |     Status:  new
 Priority:  normal   |  Milestone:  7.2.0
Component:  PyGRASS  |    Version:  svn-releasebranch72
 Keywords:           |        CPU:  x86-64
 Platform:  Linux    |
---------------------+---------------------------------
 When trying to drop an existing table, PyGRASS crash.

 The table is created as follow:

 {{{
 l_junc = Link(layer=LAYER_JUNCTION, name=KWD_SECT_JUNCTION,
                 table=vect_map.name + TN_JUNCTION, key='cat')
 t_junc = l_junc.table()
 t_junc.create(COLS_JUNCTION)
 }}}

 When trying to drop the table or rewrite it:
 {{{
 if t_junc.exist():
     t_junc.drop(force=True)
 }}}
 {{{
 t_junc.create(COLS_JUNCTION, overwrite=True)
 }}}

 It gives the following error:

 {{{
 Traceback (most recent call last):
   File "./v.in.swmm.py", line 196, in <module>
     sys.exit(main())
   File "./v.in.swmm.py", line 189, in main
     write_vector(output_map, drainage_network)
   File "./v.in.swmm.py", line 75, in write_vector
     t_junc.drop(force=True)
   File "/usr/lib/grass72/etc/python/grass/pygrass/vector/table.py", line
 1022, in drop
     used = db_table_in_vector(self.name)
   File "/usr/lib/grass72/etc/python/grass/script/db.py", line 192, in
 db_table_in_vector
     for f in vector_db(vect, stderr=nuldev).values():
   File "/usr/lib/grass72/etc/python/grass/script/vector.py", line 49, in
 vector_db
     **args)
   File "/usr/lib/grass72/etc/python/grass/script/core.py", line 461, in
 read_command
     return handle_errors(returncode, stdout, args, kwargs)
   File "/usr/lib/grass72/etc/python/grass/script/core.py", line 329, in
 handle_errors
     returncode=returncode)
 grass.exceptions.CalledModuleError: Module run None ['v.db.connect', '--
 q', '-g', 'map=drainage_network at kolkata', 'sep=;'] ended with error
 Process ended with non-zero return code 1. See errors in the (error)
 output.
 }}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3211>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list