[Python] "Error Binding Parameter 1: built-in function or method is not supported" when saving...

Discussão em 'Python' iniciado por Stack, Agosto 9, 2025.

  1. Stack

    Stack Membro Participativo

    In this password manager project, whenever I try to save the master password, an error always come up that says,

    [​IMG]

    One of the main problems here is that in my program, on your first time opening it you have to make a master password which is saved, and then the next time you open it you have to enter the master password, however, in my case even if the master password is saved I still get to the first time create master password screen and then the error shows up. This is the code in question:

    import sqlite3, hashlib
    from tkinter import *


    #Database code
    with sqlite3.connect("password_vault.db") as db:
    cursor = db.cursor()

    cursor.execute("""
    CREATE TABLE IF NOT EXISTS masterpassword(
    id INTEGER PRIMARY KEY,
    password TEXT NOT NULL);
    """)



    #Initiate Window
    window = Tk()
    window.title("Password vault")

    def hashPassword(input):
    hash = hashlib.md5(input)
    hash = hash.hexdigest

    return hash



    def firstScreen():
    window.geometry("250x150")

    lbl = Label(window, text="Create Master Password")
    lbl.config(anchor=CENTER)
    lbl.pack()

    txt = Entry(window, width=20)
    txt.pack()
    txt.focus()

    lbl1 = Label(window, text="Re-enter Password")
    lbl1.pack()

    txt1 = Entry(window, width=20)
    txt1.pack()

    lbl2 = Label(window)
    lbl2.pack()

    def savePassword():
    if txt.get() == txt1.get():
    hash_pass = hashPassword(txt.get().encode("utf-8"))

    insert_password = """INSERT INTO masterpassword(password)
    VALUES(?) """
    cursor.execute(insert_password, [(hash_pass)])
    db.commit()

    passwordVault()
    else:
    lbl2.config(text="Passwords do not match")

    btn = Button(window, text="Save", command=savePassword)
    btn.pack(pady=10)


    def loginScreen():
    window.geometry("250x150")

    lbl = Label(window, text="Enter Master Password")
    lbl.config(anchor=CENTER)
    lbl.pack()

    txt = Entry(window, width=20) #, show="*")
    txt.pack()
    txt.focus()

    lbl1 = Label(window)
    lbl1.pack()

    def getMasterPassword():
    checkHashedPassword = hashPassword(txt.get().encode("utf-8"))
    cursor.execute("SELECT * FROM masterpassword WHERE id = 1 AND password = ?", [(checkHashedPassword)])

    return cursor.fetchall()


    def checkPassword():
    match = getMasterPassword()



    if match:
    passwordVault()
    else:
    txt.delete(0, 'end')
    lbl1.config(text="Wrong Password")


    btn = Button(window, text="Submit", command=checkPassword)
    btn.pack(pady=10) #pack on its own puts it automatically in the center


    def passwordVault():
    for widget in window.winfo_children():
    widget.destroy() #clears page

    window.geometry("750x350")

    lbl = Label(window, text="Password Vault")
    lbl.config(anchor=CENTER)
    lbl.pack()


    # check = cursor.execute("SELECT * FROM masterpassword")

    if cursor.fetchall():
    loginScreen()
    else:
    firstScreen() # loginScreen()
    window.mainloop()


    It used to work before, but after I added the hash features all sorts of errors came up. How to fix?

    Continue reading...

Compartilhe esta Página