Skip to content

Error from sqlite3 initialising sqlite. #1646

@MichaelBellBOM

Description

@MichaelBellBOM

Describe the bug
When running coverage.
I get Couldn't use data file '/home/mbell/projects/api-aac/.coverage': Safety level may not be changed inside a transaction
This is because for certain builds of sqlite3 synchronous
To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:

  1. What version of Python are you using?
    3.10.4
  2. What version of coverage.py shows the problem? The output of coverage debug sys is helpful.
    coverage==7.2.1
  3. What versions of what packages do you have installed? The output of pip freeze is helpful.
    pytest==7.3.2
    pytest-cov==4.1.0
  4. What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
    The problem is there is not exactly any visible code, this issue occurs when running:
    coverage json or pytest --json-report --json-report-file nosetests.json --cov tests/ tests/
    The reason this is occurring because of differences in the _sqlite3.so file even if the same version of sqlite3.
    If I run PYTHONPATH=. coverage json --debug=sql
    The out put is
Connecting to '/home/mbell/projects/api-aac/.coverage'
Executing 'pragma journal_mode=off'
Executing 'pragma synchronous=off'
EXCEPTION from execute: Safety level may not be changed inside a transaction
Couldn't use data file '/home/mbell/projects/api-aac/.coverage': Safety level may not be changed inside a transaction

If I change the installed libraries to run pragma synchronous=off before pragma journal_mode=off. Then everything works successfully

  1. What commands should we run to reproduce the problem? Be specific. Include everything, even git clone, pip install, and so on. Explain like we're five!
    On Linux:
    Get a version of a _sqlite3.so file and put it in a root directory of the project.
    Make sure coverage is installed pip install coverage
    Run coverage json

Expected behavior
A clear and concise description of what you expected to happen.
Run coverage without sqlite triggered error.

Additional context
Using the _sqlite3.so binary directly as it has been taken from an appropriate environment to be used inside aws lambda for python3.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions