You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
yycoolsam
changed the title
xinfo_stream
xinfo_stream IndexError: list index out of range
Dec 6, 2023
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,
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.
The text was updated successfully, but these errors were encountered: