Dolamite Jenkins
asked on
TypeError: not all arguments converted during string formatting
trying to get the correct python syntax for aes_decrypting
ive tried
and got
then i tried
and got
ive tried
key="special"
cursor.execute("SELECT AES_DECRYPT(Last_name, %s) AS Last_name_decrypted, ptrecords.* FROM ptrecords ", (key));
and got
Traceback (most recent call last):
File "C:\Python26\sign\MYSQL_NEW_SERVER_SIDE._II.py", line 7025, in run
Provider_1,Provider_2,Sys,Dia,Pulse,Resp,Weather, Temp,Humid,Wind,TimeStamp,Refusal,image))
ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.
then i tried
key="special"
cursor.execute("SELECT AES_DECRYPT(Last_Name, %s) AS Last_name_decrypted, ptrecords.* FROM ptrecords ", (key,'special'));
and got
Traceback (most recent call last):
File "C:\Python26\sign\MYSQL_NEW_SERVER_SIDE._II.py", line 6981, in run
cursor.execute("SELECT AES_DECRYPT(Last_Name, %s) AS Last_name_decrypted, ptrecords.* FROM ptrecords ", (key,'special'));
File "C:\Python26\lib\site-packages\MySQLdb\cursors.py", line 158, in execute
query = query % db.literal(args)
TypeError: not all arguments converted during string formatting
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER