summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2018-12-27 23:58:40 -0800
committerAndy McCurdy <andy@andymccurdy.com>2018-12-27 23:58:40 -0800
commit4ae98e7de18f16fb669b74ee09245ff4de3da0b4 (patch)
treea3e5b9fde052f2f9f3a2d7a0207a0951ef7b071c
parent0edfc3d252f4b7f0f38eb408f90e8cbcab8fd683 (diff)
downloadredis-py-4ae98e7de18f16fb669b74ee09245ff4de3da0b4.tar.gz
Encode Stream message names within XREAD and XREADGROUP responses correctly
Stream message now respect the decode_responses flag.
-rw-r--r--CHANGES4
-rwxr-xr-xredis/client.py2
-rw-r--r--tests/test_commands.py10
3 files changed, 9 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index efcf285..524f47e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,6 @@
-* 3.0.2 (in development)
+* 3.1.0 (in development)
+ * Stream names found within XREAD and XREADGROUP responses now properly
+ respect the decode_responses flag.
* XPENDING_RANGE now requires the user the specify the min, max and
count arguments. Newer versions of Redis prevent ount from being
infinite so it's left to the user to specify these values explicitly.
diff --git a/redis/client.py b/redis/client.py
index 60270ae..3411486 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -276,7 +276,7 @@ def parse_xinfo_stream(response):
def parse_xread(response):
if response is None:
return []
- return [[nativestr(r[0]), parse_stream_list(r[1])] for r in response]
+ return [[r[0], parse_stream_list(r[1])] for r in response]
def parse_xpending(response, **options):
diff --git a/tests/test_commands.py b/tests/test_commands.py
index a269ca7..566437d 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -2124,7 +2124,7 @@ class TestRedisCommands(object):
expected = [
[
- stream,
+ stream.encode(),
[
get_stream_message(r, stream, m1),
get_stream_message(r, stream, m2),
@@ -2136,7 +2136,7 @@ class TestRedisCommands(object):
expected = [
[
- stream,
+ stream.encode(),
[
get_stream_message(r, stream, m1),
]
@@ -2147,7 +2147,7 @@ class TestRedisCommands(object):
expected = [
[
- stream,
+ stream.encode(),
[
get_stream_message(r, stream, m2),
]
@@ -2170,7 +2170,7 @@ class TestRedisCommands(object):
expected = [
[
- stream,
+ stream.encode(),
[
get_stream_message(r, stream, m1),
get_stream_message(r, stream, m2),
@@ -2185,7 +2185,7 @@ class TestRedisCommands(object):
expected = [
[
- stream,
+ stream.encode(),
[
get_stream_message(r, stream, m1),
]