摘要:
1)当text是二进制流时, chr(BS - len(s) % BS).encode("utf-8")里的".encode("utf-8")"是不能少的, 不然会有如下错误:
TypeError: can't concat str to bytes
2)Key必须要.encode('utf-8'): key.encode('utf-8') , 32位的key
3)IV必须要.encode('utf-8') : str(key[0:16]).encode('utf-8'),从32位的key取16位当做IV的输入值 阅读全文
摘要:
#如果要捕捉pymysql, 要用到这个库:
from warnings import filterwarnings
filterwarnings("error",category=pymysql.Warning)
#然后“except Exception as e:“变成
except pymysql.Warning as e:
print(e)
#但是坑在这里了,一旦出现pymysql.Warning, 就会触发db.rollback(),数据不会被保存!! 阅读全文