-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Version: redis-py version 5.0.1, Redis: 6.0(23.8.1.3)
Platform: Python3.8.10 on WIN10
Description: redis-py fails to parse xinfo_stream replies if the stream is emptied by XTRIM command.
For example,
File "E:\Program\qhdata_etl\src\venv\lib\site-packages\redis\client.py", line 513, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
File "E:\Program\qhdata_etl\src\venv\lib\site-packages\redis\client.py", line 563, in parse_response
return self.response_callbacks[command_name](response, **options)
File "E:\Program\qhdata_etl\src\venv\lib\site-packages\redis\_parsers\helpers.py", line 272, in parse_xinfo_stream
data["first-entry"] = (first[0], pairs_to_dict(first[1]))
IndexError: list index out of range
After inspecting the source code, I believe this issue is platform-independent. parse_xinfo_stream function in client.py assumes that first-entry and last-entry in the reply are valid enties. However, after XTRIM STREAM MAXLEN 0, those two fields will become [None], which leads to the parse error.
Metadata
Metadata
Assignees
Labels
No labels