Git Product home page Git Product logo

Comments (8)

Nikratio avatar Nikratio commented on June 20, 2024

For completeness:

In [7]: apsw.sqlitelibversion()
Out[7]: '3.40.1'

from apsw.

Nikratio avatar Nikratio commented on June 20, 2024

The above was with apsw shipped from Debian bullseye. Current PyPi version (3.42) seems to work fine.

Is this a known problem in 3.40.0.

from apsw.

rogerbinns avatar rogerbinns commented on June 20, 2024

Before SQLite 3.42 it would only allow the log handler (SQLITE_CONFIG_LOG) to be changed before the full initialization of the SQLite library. ie you would need to install the log handler immediately after import and before any other operation. If done after initialization there would be MISUSE_ERROR.

from apsw.

rogerbinns avatar rogerbinns commented on June 20, 2024

Is this a known problem in 3.40.0.

To support SQLite before 3.42 you'll need to install the log handler immediately after import before doing any operations.

The documentation currently only covers the current version. I've avoided trying to be multi-version due to the complexity and increased workload.

from apsw.

Nikratio avatar Nikratio commented on June 20, 2024

Hmm. This error started showing up after I upgraded my system to current Debian stable. So the same code was working with some past version. Checking ~/.local/lib and /usr/local/lib I also do not see any more recent apsw versions, so I'm pretty sure whatever was shipped with Debian in the previous release supported this. Odd.

from apsw.

rogerbinns avatar rogerbinns commented on June 20, 2024

You probably got lucky in that the install logger call happened before anything else called into SQLite. All it takes is a site package to disturb things. For example on Ubuntu apport changes sys.excepthook which then causes other Python code to behave differently! Unless you have whole system snapshots it will be hard to diagnose.

Behind the scenes APSW is just calling sqlite3_config(SQLITE_CONFIG_LOG, handler) without any sophistication or magic.

from apsw.

rogerbinns avatar rogerbinns commented on June 20, 2024

You can diagnose what is causing SQLite to be initialized:

$ gdb --args python3 myscript.py
(gdb) b sqlite3_initialize
Function "sqlite3_initialize" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (sqlite3_initialize) pending.
(gdb) run

from apsw.

Nikratio avatar Nikratio commented on June 20, 2024

thanks!

from apsw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.