diff options
author | Jakob Keller <57402305+jakob-keller@users.noreply.github.com> | 2019-11-11 23:58:16 +0100 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2019-11-11 14:58:16 -0800 |
commit | 375839679e5faf1cf8fda4ce822284dcb664b1b9 (patch) | |
tree | f6a429c8db1438791c3adcb2658bdb31ff75b595 | |
parent | 74b044c3e729cbb6e65126e993b90902114f0293 (diff) | |
download | redis-py-375839679e5faf1cf8fda4ce822284dcb664b1b9.tar.gz |
Fix TypeError by passing optional decode_responses keyword argument d… (#1239)
* Fix TypeError by passing optional decode_responses keyword argument down to parse_slowlog_get()
-rwxr-xr-x | redis/client.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index d77ef01..35d2cfe 100755 --- a/redis/client.py +++ b/redis/client.py @@ -389,11 +389,12 @@ def parse_zscan(response, **options): def parse_slowlog_get(response, **options): + space = ' ' if options.get('decode_responses', False) else b' ' return [{ 'id': item[0], 'start_time': int(item[1]), 'duration': int(item[2]), - 'command': b' '.join(item[3]) + 'command': space.join(item[3]) } for item in response] @@ -1195,7 +1196,9 @@ class Redis(object): args = ['SLOWLOG GET'] if num is not None: args.append(num) - return self.execute_command(*args) + decode_responses = self.connection_pool.connection_kwargs.get( + 'decode_responses', False) + return self.execute_command(*args, decode_responses=decode_responses) def slowlog_len(self): "Get the number of items in the slowlog" |