I have created a sqlite db and uploaded it to a hosting.
Then I'm retrieving it from my script and trying to insert some data, but execute() is returning a
DatabaseError (file is encrypted or is not a database).
urllib.urlretrieve('http://%s/%s' % (HOST, NAME_DB), NAME_DB)
con = sqlite3.connect(NAME_DB)
cur = con.cursor()
cur.execute('insert into log(date, count, average) values(date("now"), ?, ?)', (1, 1.2))
con.commit()
con.close()
Traceback (most recent call last):
File "mylog.py", line 17, in <module>
cur.execute('insert into log(date, count, average) values(date("now"), ?, ?)', (1, 1.2))
sqlite3.DatabaseError: file is encrypted or is not a database
Such error doesn't happen if I use the sqlite CLI to insert data. Could you please help me?