You are ignoring the nam
parameter and using sys.argv[1]
for all calls to open_db()
:
def open_db(nam):
conn = sqlite3.connect(sys.argv[1])
This opens the first named database twice, as both src_conn
and dest_conn
. Use nam
instead:
def open_db(nam):
conn = sqlite3.connect(nam)