Advertisement
Guest User

Simplified python redis WRONGTYPE error

a guest
Feb 19th, 2017
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.82 KB | None | 0 0
  1. In [23]: k = p.keys()
  2.  
  3. In [24]: print k
  4. ['frontend:test.ufam.jp']
  5.  
  6. In [25]: p.type(k.pop())
  7. Out[25]: 'string'
  8.  
  9. In [26]: k = p.keys()
  10.  
  11. In [27]: p.lrange(k.pop(),1,1)
  12. ---------------------------------------------------------------------------
  13. ResponseError                             Traceback (most recent call last)
  14. <ipython-input-27-3130ef3ccf8c> in <module>()
  15. ----> 1 p.lrange(k.pop(),1,1)
  16.  
  17. /usr/local/lib/python2.7/dist-packages/redis/client.pyc in lrange(self, name, start, end)
  18.    1239         Python slicing notation
  19.    1240         """
  20. -> 1241         return self.execute_command('LRANGE', name, start, end)
  21.   1242
  22.   1243     def lrem(self, name, count, value):
  23.  
  24. /usr/local/lib/python2.7/dist-packages/redis/client.pyc in execute_command(self, *args, **options)
  25.    571         try:
  26.    572             connection.send_command(*args)
  27. --> 573             return self.parse_response(connection, command_name, **options)
  28.    574         except (ConnectionError, TimeoutError) as e:
  29.    575             connection.disconnect()
  30.  
  31. /usr/local/lib/python2.7/dist-packages/redis/client.pyc in parse_response(self, connection, command_name, **options)
  32.    583     def parse_response(self, connection, command_name, **options):
  33.    584         "Parses a response from the Redis server"
  34. --> 585         response = connection.read_response()
  35.    586         if command_name in self.response_callbacks:
  36.    587             return self.response_callbacks[command_name](response, **options)
  37.  
  38. /usr/local/lib/python2.7/dist-packages/redis/connection.pyc in read_response(self)
  39.    580             raise
  40.    581         if isinstance(response, ResponseError):
  41. --> 582             raise response
  42.    583         return response
  43.    584
  44.  
  45. ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value
  46.  
  47. In [28]:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement