sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

Ben Bacarisse ben.usenet at bsb.me.uk
Wed Jan 20 15:09:46 EST 2021


panfei <cnweike at gmail.com> writes:

> 4. Test sqlite3
> Python 3.9.1 (default, Jan 20 2021, 14:32:50)
> [GCC 10.2.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import sqlite3
>>>> conn = sqlite3.connect(':memory:')
>>>> conn.create_function('f', 2, lambda *args: None, deterministic=True)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> sqlite3.NotSupportedError: deterministic=True requires SQLite 3.8.3 or higher
>>>> sqlite3.sqlite_version
> '3.34.0'
>>>> sqlite3.version
> '2.6.0'
>>>> 
>
> It reports "deterministic=True requires SQLite 3.8.3 or higher", but
> when execute sqlite3.sqlite_version it returns 3.34.0 which higher
> than 3.8.3.
>
> Is there any advice on this issue? thanks.

Sorry, no, but I can add a data point.  It works for me on my Ubuntu
system with these versions:

$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.31.1'
>>> sqlite3.version
'2.6.0'
>>> conn = sqlite3.connect(':memory:')
>>> conn.create_function('f', 2, lambda *args: None, deterministic=True)
>>> 

-- 
Ben.


More information about the Python-list mailing list