[Python] UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 55: invalid...

Discussão em 'Python' iniciado por Stack, Abril 18, 2025.

  1. Stack

    Stack Membro Participativo

    import psycopg2

    conn = psycopg2.connect(dbname="postgres", user="postgres", password="123456", host="127.0.0.1")
    cursor = conn.cursor()

    cursor.close()
    conn.close()


    Error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 55: invalid continuation byte

    I tried to reinstall psycopg2 and completely rewrite code but it didn't help. Encoding in vscode is UTF-8.

    Continue reading...

Compartilhe esta Página