./countkeyredis.py -p 6379 localhost
Traceback (most recent call last):
File “./countkeyredis.py”, line 30, in ?
redis_info = r.info()
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 380, in info
return self.execute_command(‘INFO’)
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 253, in execute_command
‘*%s\r\n%s’ % (len(cmds), ”.join(cmds)),
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 239, in _execute_command
return self.parse_response(command_name, **options)
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 261, in parse_response
return self.RESPONSE_CALLBACKS[command_name](response, **options)
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 81, in parse_info
info[key] = get_value(value)
File “/usr/lib/python2.4/site-packages/redis/client.py”, line 66, in get_value
k, v = item.rsplit(‘=’, 1)

Source: client.py

Org:

 sub_dict = {}
        for item in value.split(‘,’):
            k, v = item.rsplit(‘=’, 1)
            try:
                sub_dict[k] = int(v)
            except ValueError:
                sub_dict[k] = v
        return sub_dict
Fix:

if ‘=’ in value:
sub_dict = {}
for item in value.split(‘,’):
k, v = item.rsplit(‘=’, 1)
try:

sub_dict[k] = int(v)
except ValueError:
sub_dict[k] = v
return sub_dict
else:
return value.split(‘,’)