Permalink
Browse files

fix for #217 to make the INFO command parsing more tolerant

  • Loading branch information...
1 parent 60e3be5 commit 485a7918bb91846c219ff3213ec2d6e66b40e8ae @andymccurdy andymccurdy committed Jan 13, 2012
Showing with 6 additions and 2 deletions.
  1. +3 −1 CHANGES
  2. +3 −1 redis/client.py
View
@@ -1,8 +1,10 @@
-* 2.4.11 (in development)
+* 2.4.11
* AuthenticationError will now be correctly raised if an invalid password
is supplied.
* If Hiredis is unavailable, the HiredisParser will raise a RedisError
if selected manually.
+ * Made the INFO command more tolerant of Redis changes formatting. Fix
+ for #217.
* 2.4.10
* Buffer reads from socket in the PythonParser. Fix for a Windows-specific
bug (#205).
View
@@ -71,8 +71,9 @@ def parse_info(response):
info = {}
def get_value(value):
- if ',' not in value:
+ if ',' not in value or '=' not in value:
return value
+
sub_dict = {}
for item in value.split(','):
k, v = item.rsplit('=', 1)
@@ -81,6 +82,7 @@ def get_value(value):
except ValueError:
sub_dict[k] = v
return sub_dict
+
for line in response.splitlines():
if line and not line.startswith('#'):
key, value = line.split(':')

0 comments on commit 485a791

Please sign in to comment.