Skip to content

Commit

Permalink
fix for redis#217 to make the INFO command parsing more tolerant
Browse files Browse the repository at this point in the history
  • Loading branch information
andymccurdy committed Jan 13, 2012
1 parent 60e3be5 commit 485a791
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
4 changes: 3 additions & 1 deletion redis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(':')
Expand Down

0 comments on commit 485a791

Please sign in to comment.