在本地运行没有异常,在测试服务器上运行时出现 TypeError: ‘iv’ is an invalid keyword argument for this function 异常,具体日志信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Traceback (most recent call last): File "app.py", line 7, in <module> import ynservice File "/data/wechat-api/ynservice.py", line 153, in <module> process(t_d) File "/data/wechat-api/ynservice.py", line 89, in process decrypted_str = aes_decrypt(encoding_content) File "/data/wechat-api/ynservice.py", line 54, in aes_decrypt aes = AES.new(key=encoding_aes_key.encode(), mode=AES.MODE_CBC, iv=iv.encode()) File "/usr/local/lib64/python3.6/site-packages/Crypto/Cipher/AES.py", line 95, in new return AESCipher(key, *args, **kwargs) File "/usr/local/lib64/python3.6/site-packages/Crypto/Cipher/AES.py", line 59, in __init__ blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs) File "/usr/local/lib64/python3.6/site-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__ self._cipher = factory.new(key, *args, **kwargs) TypeError: 'iv'is an invalid keyword argument for this function