Bug#659483: libspatialite: SpatiaLite library shows ugly messages to stdout when it's loaded, no way to turn them off

Ramiro Morales ramiro+debian at rmorales.net
Sat Feb 11 13:27:52 UTC 2012


Package: libspatialite3
Version: 3.0.0~beta20110817-3
Severity: normal
File: libspatialite

Dear Maintainer,

The SpatiaLite library shows this report every time it is loaded:

SpatiaLite version ..: 3.0.0-beta       Supported Extensions:
        - 'VirtualShape'        [direct Shapefile access]
        - 'VirtualDbf'          [direct Dbf access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualXL'           [direct XLS access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualNetwork'      [Dijkstra shortest path]
        - 'RTree'               [Spatial Index - R*Tree]
        - 'MbrCache'            [Spatial Index - MBR cache]
        - 'VirtualSpatialIndex' [R*Tree metahandler]
        - 'VirtualFDO'          [FDO-OGR interoperability]
        - 'SpatiaLite'          [Spatial SQL - OGC]
PROJ.4 Rel. 4.7.1, 23 September 2009
GEOS version 3.2.2-CAPI-1.6.2

Examples with three different tools:

a) Traditional sqlite3 tool shipped with package of the same name:

$ sqlite3 test1.sqlite
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .load libspatialite.so.3
SpatiaLite version ..: 3.0.0-beta       Supported Extensions:
        - 'VirtualShape'        [direct Shapefile access]
        - 'VirtualDbf'          [direct Dbf access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualXL'           [direct XLS access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualNetwork'      [Dijkstra shortest path]
        - 'RTree'               [Spatial Index - R*Tree]
        - 'MbrCache'            [Spatial Index - MBR cache]
        - 'VirtualSpatialIndex' [R*Tree metahandler]
        - 'VirtualFDO'          [FDO-OGR interoperability]
        - 'SpatiaLite'          [Spatial SQL - OGC]
PROJ.4 Rel. 4.7.1, 23 September 2009
GEOS version 3.2.2-CAPI-1.6.2


b) spatialite utility shipped with spatialite-bin package:

$ spatialite test2.sqlite
SpatiaLite version ..: 3.0.0-beta       Supported Extensions:
        - 'VirtualShape'        [direct Shapefile access]
        - 'VirtualDbf'          [direct DBF access]
        - 'VirtualXL'           [direct XLS access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualNetwork'      [Dijkstra shortest path]
        - 'RTree'               [Spatial Index - R*Tree]
        - 'MbrCache'            [Spatial Index - MBR cache]
        - 'VirtualSpatialIndex' [R*Tree metahandler]
        - 'VirtualFDO'          [FDO-OGR interoperability]
        - 'SpatiaLite'          [Spatial SQL - OGC]
PROJ.4 version ......: Rel. 4.7.1, 23 September 2009
GEOS version ........: 3.2.2-CAPI-1.6.2
SQLite version ......: 3.7.9
Enter ".help" for instructions
spatialite>

c) Loading spatialite from Python code via standalone pysqlite DB-API
   (python-pysqlite2 package):

$ python
Python 2.7.2+ (default, Jan 20 2012, 23:05:38) 
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pysqlite2 import dbapi2
>>> print(dbapi2.sqlite_version)
3.7.9
>>> print(dbapi2.version)
2.6.3
>>> conn = dbapi2.connect(**{'database': 'test3.sqlite'})
>>> conn.enable_load_extension(True)
>>> cur = conn.cursor()
>>> cur.execute("SELECT load_extension('libspatialite.so.3')")
SpatiaLite version ..: 3.0.0-beta       Supported Extensions:
        - 'VirtualShape'        [direct Shapefile access]
        - 'VirtualDbf'          [direct Dbf access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualXL'           [direct XLS access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualNetwork'      [Dijkstra shortest path]
        - 'RTree'               [Spatial Index - R*Tree]
        - 'MbrCache'            [Spatial Index - MBR cache]
        - 'VirtualSpatialIndex' [R*Tree metahandler]
        - 'VirtualFDO'          [FDO-OGR interoperability]
        - 'SpatiaLite'          [Spatial SQL - OGC]
PROJ.4 Rel. 4.7.1, 23 September 2009
GEOS version 3.2.2-CAPI-1.6.2
<pysqlite2.dbapi2.Cursor object at 0xb7260920>


There doesn't seem to be any hook in sqlite3 extensions API or
SpatiaLite API to silence it.

It is printed from the spatialite_init(int verbose) function
in libspatialite-3.0.0-stable/src/spatialite/spatialite.c:16546
(that, by the 

/* used when SQLite initializes SpatiaLite via statically linked lib */

comment is supposed to be called only when SpatiaLite is loaded
statically from sqlite?) but I'm unable to follow the execution stack, to
understand why that function is getting called in the first place if
SpatiaLite is being loaded dynamically and how to influence the value of
its `verbose` argument.

Unconditionally printing random stuff to stdout from a library being
dinamically doesn't seem right. The scenario where I'm seeing is when
runnning tests in a stack using sqplite/SpatiaLite (Django Python Web
framework pus its GeoDjango sub-framework own test suite)

Regards,

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2-2.slh.1-aptosid-686 (SMP w/3 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libspatialite3 depends on:
ii  libc6         2.13-24
ii  libfreexl1    0.0.2~beta20110817-1
ii  libgeos-c1    3.2.2-3.1
ii  libproj0      4.7.0-1
ii  libsqlite3-0  3.7.9-2

libspatialite3 recommends no packages.

libspatialite3 suggests no packages.

-- no debconf information





More information about the Pkg-grass-devel mailing list