Package: python2.7
Version: 2.7.6-4
Severity: normal

Dear Maintainer (Matthias?),

It appears that the sqlite3 module in the Python2.7 std library
(and all of Python2.x and Python3.x to be specific) were built with
the loading of SQLite extension libraries DISABLED (e.g. extension
libraries such as libspatialite). This makes it impossible to use
SQLite extensions from with Python (a core feature).

I have attached a short Bourne shell script that demonstrates
the problem. (See test_script.sh attachment).

The upstream documentation from python.org for the sqlite3 module
states that the loading of extensions is disabled by default in
the source tarball due to problems on Mac OS X. See the footnote[1]
at the very end of that page for more detail;

http://docs.python.org/2/library/sqlite3.html

There should not be any issues with allowing extensions on
Linux. Note that the loading of extension libraries is already
enabled in the stand alone sqlite3 application (from the separate
package sqlite), by using the ".load" command.

As noted on the upstream documentation for the sqlite3 module,
the fix is straight forward. The line in the setup.py script (from
upstream python tarball) that sets SQLITE_OMIT_LOAD_EXTENSION should
be commented out;

--- python2.7-2.7.6/setup.py.orig       2013-11-09 23:36:41.000000000 -0800
+++ python2.7-2.7.6/setup.py    2014-02-19 13:28:18.398356938 -0800
@@ -1170,7 +1170,7 @@ class PyBuildExt(build_ext):
                 sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"'))
 
             # Comment this out if you want the sqlite3 module to be able to 
load extensions.
-            sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))
+            # sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))
 
             if host_platform == 'darwin':
                 # In every directory on the search path search for a dynamic

Best Regards, John



-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.12-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) 
(ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash

Versions of packages python2.7 depends on:
ii  libpython2.7-stdlib  2.7.6-4
ii  mime-support         3.54
ii  python2.7-minimal    2.7.6-4

python2.7 recommends no packages.

Versions of packages python2.7 suggests:
ii  binutils       2.24-2
pn  python2.7-doc  <none>

-- no debconf information

Attachment: test_script.sh
Description: Bourne shell script

Reply via email to