标签:使用 command input ict encode traceback weixin https ima
使用redis包过程中出现如下问题:
Traceback (most recent call last):
File "Check_UaPool.py", line 92, in <module>
r.srem(REDIS_KEY,IP)
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/client.py", line 1940, in srem
return self.execute_command(‘SREM‘, name, *values)
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/client.py", line 774, in execute_command
connection.send_command(*args)
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/connection.py", line 619, in send_command
self.send_packed_command(self.pack_command(*args))
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/connection.py", line 659, in pack_command
for arg in imap(self.encoder.encode, args):
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/connection.py", line 124, in encode
"byte, string or number first." % typename)
redis.exceptions.DataError: Invalid input of type: ‘dict‘. Convert to a byte, string or number first.
原因:python中redis包更新导致的问题,变更了srem方法的输入。
解决方法:
pip install redis==2.10.6
问题得到解决。
原文:https://blog.csdn.net/weixin_39128119/article/details/87373091
标签:使用 command input ict encode traceback weixin https ima
原文地址:https://www.cnblogs.com/marry215464/p/10493683.html