summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2014-12-05 13:03:38 -0500
committerAndy McCurdy <andy@andymccurdy.com>2014-12-05 13:03:38 -0500
commit38b19cd3098f0c21510a5565dae349bd1caef6dc (patch)
treee135fe34d53cb9319fd18767f5de72c4dbade30f /redis/client.py
parentfa714e08ef59d37b145616cb60939eedafda0bd4 (diff)
parenteddf49d774945986325a04e134b0ba42e0046e70 (diff)
downloadredis-py-38b19cd3098f0c21510a5565dae349bd1caef6dc.tar.gz
Merge pull request #564 from hendrik-cliqz/fix-unicode-conversion-in-exception-handling
Fix UnicodeDecodeError in annotate_excpetion
Diffstat (limited to 'redis/client.py')
-rwxr-xr-xredis/client.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/redis/client.py b/redis/client.py
index e444571..70024af 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -6,7 +6,8 @@ import warnings
import threading
import time as mod_time
from redis._compat import (b, basestring, bytes, imap, iteritems, iterkeys,
- itervalues, izip, long, nativestr, unicode)
+ itervalues, izip, long, nativestr, unicode,
+ safe_unicode)
from redis.connection import (ConnectionPool, UnixDomainSocketConnection,
SSLConnection, Token)
from redis.lock import Lock, LuaLock
@@ -2532,9 +2533,9 @@ class BasePipeline(object):
raise r
def annotate_exception(self, exception, number, command):
- cmd = unicode(' ').join(imap(unicode, command))
+ cmd = safe_unicode(' ').join(imap(safe_unicode, command))
msg = unicode('Command # %d (%s) of pipeline caused error: %s') % (
- number, cmd, unicode(exception.args[0]))
+ number, cmd, safe_unicode(exception.args[0]))
exception.args = (msg,) + exception.args[1:]
def parse_response(self, connection, command_name, **options):