Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scard seems to not work #12

Closed
Starow opened this issue Jul 7, 2014 · 2 comments
Closed

Scard seems to not work #12

Starow opened this issue Jul 7, 2014 · 2 comments
Assignees
Labels

Comments

@Starow
Copy link

Starow commented Jul 7, 2014

This is a little example as a "proof of bug" In normal redis this command (r_serv.scard("i")) would return a "0" if not existing: http://redis.io/commands/scard

In [1]: import redis
In [3]: r_serv = redis.StrictRedis("127.0.0.1", 8323, 10)
In [4]: r_serv.smembers("i")
Out[4]: set([])
In [5]: r_serv.scard("i")

TypeError Traceback (most recent call last)
in ()
----> 1 r_serv.scard("i")

/usr/local/lib/python2.7/dist-packages/redis/client.pyc in scard(self, name)
1250 def scard(self, name):
1251 "Return the number of elements in set name"
-> 1252 return self.execute_command('SCARD', name)
1253
1254 def sdiff(self, keys, *args):

/usr/local/lib/python2.7/dist-packages/redis/client.pyc in execute_command(self, _args, *_options)
459 try:
460 connection.send_command(_args)
--> 461 return self.parse_response(connection, command_name, *_options)
462 except ConnectionError:
463 connection.disconnect()

/usr/local/lib/python2.7/dist-packages/redis/client.pyc in parse_response(self, connection, command_name, *_options)
471 response = connection.read_response()
472 if command_name in self.response_callbacks:
--> 473 return self.response_callbacks command_name (response, *_options)
474 return response
475

TypeError: int() argument must be a string or a number, not 'NoneType'

@KDr2
Copy link
Owner

KDr2 commented Jul 7, 2014

@Starow Thank for your reporting, I just fixed it by cac54f3. Please try it again :)

@KDr2 KDr2 added the bug label Jul 7, 2014
@KDr2 KDr2 self-assigned this Jul 7, 2014
@KDr2 KDr2 closed this as completed Jul 7, 2014
@Starow
Copy link
Author

Starow commented Jul 7, 2014

It's working :)

In [3]: r_serv.scard("i")
Out[3]: 0

Thank you for this fast fix !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants