This code which has been working for years has now suddenly started returning the above error even for a newly created database.
Here’s the relevant code snippet:
dbfile = os.path.expanduser(dbfile)
import sqlite3 as sqlite
dbsetup = not os.path.isfile(dbfile)
conn = sqlite.connect(dbfile)
c = conn.cursor()
if dbsetup:
c.execute("create table counters (module text, counter int)")
c.execute("select counter from counters where module = '%s'" % name)
r = c.fetchone()
y=global_counter(‘x’,’~/test.db’)
Traceback (most recent call last):
File “”, line 1, in
File “/data/jwst/scheduling/tools/com/spss_sys_util.py”, line 1227, in global_counter
c.execute(“create table counters (module text, counter int)”)
sqlite3.OperationalError: database is locked
Any hints as to what might be going on?
4