From 4c5680e2fd1ec6e9854693e8fd365a9fc0041d02 Mon Sep 17 00:00:00 2001 From: cyborg7898 Date: Mon, 29 May 2023 19:05:27 +0530 Subject: [PATCH] Fixed key error in parse_xinfo_stream --- CHANGES | 1 + redis/client.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 7fd510bd12..76b3393aa2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,4 @@ + * Fix #2768, Fix KeyError: 'first-entry' in parse_xinfo_stream. * Fix #2749, remove unnecessary __del__ logic to close connections. * Fix #2754, adding a missing argument to SentinelManagedConnection * Fix `xadd` command to accept non-negative `maxlen` including 0 diff --git a/redis/client.py b/redis/client.py index 9fd5b7ca9e..ab626ccdf4 100755 --- a/redis/client.py +++ b/redis/client.py @@ -320,7 +320,7 @@ def parse_xautoclaim(response, **options): def parse_xinfo_stream(response, **options): data = pairs_to_dict(response, decode_keys=True) if not options.get("full", False): - first = data["first-entry"] + first = data.get("first-entry") if first is not None: data["first-entry"] = (first[0], pairs_to_dict(first[1])) last = data["last-entry"]