I have been getting this error and have stuck a few hours trying to understand what I am doing wrong. I have use this template for successfully importing into sqlite3 many many times in the past.
def TestImport():
con = sqlite3.connect("test.db")
con.execute("CREATE TABLE IF NOT EXISTS TestTable(ColA,ColB)")
data=[('x','y')]
stmt = "INSERT INTO TestTable VALUES(?,?)"
con.execute(data,stmt)
con.commit()
con.close()
However this time I am getting this error:
ValueError: operation parameter must be str or unicode
here
con.execute(data,stmt)