python - psycopg2 "TypeError: not all arguments converted during string formatting" -


I am trying to insert binary data (a whirlpool hash) in the PG table and getting an error Type error: All arguments have not been changed during string formatting

Code:

  cur Tried to add conn.Binary ("identity_hash") to the variable before inserting .execute ("" in sessions, but before receiving it,  

Any thoughts?

Have you used "example / binary in psycopg2 source distribution? .py "is a glance at the script? It works fine here. It looks a bit different from your part:

  data1 = {'id': 1, 'name': ' Somehackers.jpg ',' img ': psycopg2.binary (open (' some hikers .jpg '). Read ())} curs.execute ("" "test_binary values ​​(% (id) s,% (name) S,% (img) s), include "data", data 1)  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -