Skip to content

Commit

Permalink
fix for non-unicode data in redis
Browse files Browse the repository at this point in the history
  • Loading branch information
fiorix committed Oct 5, 2010
1 parent a8c69d2 commit 1ee18b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cyclone/redis/protocol.py
Expand Up @@ -220,8 +220,10 @@ def bulkDataReceived(self, data):
try:
element = int(data) if data.find('.') == -1 else float(data)
except (ValueError):
element = data.decode(self.charset)

try:
element = data.decode(self.charset)
except UnicodeDecodeError:
element = data
if self.multi_bulk_length > 0:
self.handleMultiBulkElement(element)
else:
Expand Down

0 comments on commit 1ee18b3

Please sign in to comment.