[GRASS-dev] possible error in WIKI could cause data corruption

Markus Neteler neteler at osgeo.org
Sun Sep 6 05:34:42 PDT 2015


Hi,

I just remembered a change in trunk (see below):

On Sat, Sep 5, 2015 at 7:51 PM, Michael Barton <Michael.Barton at asu.edu> wrote:
...
> GRASS 7.1.svn (Spain_fieldwork_medlands_ERTS89_Z30):~ > v.db.reconnect.all -cd
> --------------------------------------------------------------------------------
> Reconnecting vector map <catastro at surveyboundaries> (1 of 9)...
> --------------------------------------------------------------------------------
> Copying table <catastro> to target database...
> Traceback (most recent call last):
>   File
> "/Applications/GRASS/GRASS-7.1.app/Contents/MacOS/scripts/db.droptable",
> line 99, in <module>
>     main()
>   File
> "/Applications/GRASS/GRASS-7.1.app/Contents/MacOS/scripts/db.droptable",
> line 77, in main
>     used = grass.db.db_table_in_vector(table)
>   File
> "/Applications/GRASS/GRASS-7.1.app/Contents/MacOS/etc/python/grass/script/db.py",
> line 184, in db_table_in_vector
>     from vector import vector_db
> ImportError: No module named vector
> ERROR: Unable to drop table <catastro>

I checked the changes to be backported (still I would appreciate that
the respective devs take care themselves):


On Mon, Aug 17, 2015 at 1:47 PM,  <svn_grass at osgeo.org> wrote:
> Author: zarch
> Date: 2015-08-17 04:47:30 -0700 (Mon, 17 Aug 2015)
> New Revision: 65947
>
> Modified:
>    grass/trunk/lib/python/script/db.py
> Log:
> script.db: Fix absolute import inside function
>
> Modified: grass/trunk/lib/python/script/db.py
> ===================================================================
> --- grass/trunk/lib/python/script/db.py 2015-08-17 08:29:14 UTC (rev 65946)
> +++ grass/trunk/lib/python/script/db.py 2015-08-17 11:47:30 UTC (rev 65947)
> @@ -181,7 +181,7 @@
>
>      :param str table: name of table to query
>      """
> -    from vector import vector_db
> +    from .vector import vector_db
>      nuldev = file(os.devnull, 'w')
>      used = []
>      vects = list_strings('vect')
>
> _______________________________________________
> grass-commit mailing list
> grass-commit at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-commit


If your local GRASS 7.trunk version is newer than 2015-08-17,
- maybe r65947 is causing the issue
else
- maybe r65947 is solving the issue
?

Markus


More information about the grass-dev mailing list