• redis包版本更新的问题


    使用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

  • 相关阅读:
    测试常用的sql语句总结
    测试常用的Linux命令总结
    【转载】vim 中如何替换选中行或指定几行内的文本
    1074 Reversing Linked List
    1077 Kuchiguse
    LC 355. Design Twitter
    LCP 5. 发 LeetCoin
    LC 1409. Queries on a Permutation With Key
    1095 Cars on Campus
    LC 1369. Get the Second Most Recent Activity
  • 原文地址:https://www.cnblogs.com/marry215464/p/10493683.html
Copyright © 2020-2023  润新知