Jump to solution
Verify

The Fix

pip install redis==7.1.0

Based on closed redis/redis-py issue #3750 · PR/commit linked

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Jump to Verify Open PR/Commit
@@ -137,11 +137,11 @@ def parse_sentinel_state(item): -def parse_sentinel_master(response): +def parse_sentinel_master(response, **options): return parse_sentinel_state(map(str_if_bytes, response))
repro.py
Traceback (most recent call last): File "/home/user/test-redispy/testbug.py", line 13, in <module> print(conn.sentinel_master("mymaster")) File "/usr/lib/python3.10/site-packages/redis/commands/sentinel.py", line 31, in sentinel_master return self.execute_command( File "/usr/lib/python3.10/site-packages/redis/client.py", line 621, in execute_command return self._execute_command(*args, **options) File "/usr/lib/python3.10/site-packages/redis/client.py", line 632, in _execute_command return conn.retry.call_with_retry( File "/usr/lib/python3.10/site-packages/redis/retry.py", line 105, in call_with_retry return do() File "/usr/lib/python3.10/site-packages/redis/client.py", line 633, in <lambda> lambda: self._send_command_parse_response( File "/usr/lib/python3.10/site-packages/redis/client.py", line 604, in _send_command_parse_response return self.parse_response(conn, command_name, **options) File "/usr/lib/python3.10/site-packages/redis/client.py", line 664, in parse_response return self.response_callbacks[command_name](response, **options) TypeError: parse_sentinel_master() got an unexpected keyword argument 'return_responses'
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: This fix should not be applied if the API behavior is expected to remain unchanged.\n\nOption C — Workaround\n- Pin redis to <=`6.2.0`\nWhen NOT to use: This fix should not be applied if the API behavior is expected to remain unchanged.\n\n

Why This Fix Works in Production

  • Trigger: print(conn.sentinel_master("mymaster"))
  • Mechanism: The sentinel_master function calls execute_command with return_responses in **options, causing a TypeError
  • Why the fix works: Adds **options to the sentinel parse functions to prevent exceptions when called with additional arguments, resolving the TypeError in sentinel_master. (first fixed release: 7.1.0).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • Shows up under Python 3.10 in real deployments (not just unit tests).
  • The sentinel_master function calls execute_command with return_responses in **options, causing a TypeError
  • Surfaces as: Traceback (most recent call last):

Proof / Evidence

  • GitHub issue: #3750
  • Fix PR: https://github.com/redis/redis-py/pull/3831
  • First fixed release: 7.1.0
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-08
  • Confidence: 0.85
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.32

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Hi @miberl, thanks for reporting this! We will investigate the issue soon.”
@petyaslavova · 2025-08-21 · source

Failure Signature (Search String)

  • print(conn.sentinel_master("mymaster"))

Error Message

Stack trace
error.txt
Error Message ------------- Traceback (most recent call last): File "/home/user/test-redispy/testbug.py", line 13, in <module> print(conn.sentinel_master("mymaster")) File "/usr/lib/python3.10/site-packages/redis/commands/sentinel.py", line 31, in sentinel_master return self.execute_command( File "/usr/lib/python3.10/site-packages/redis/client.py", line 621, in execute_command return self._execute_command(*args, **options) File "/usr/lib/python3.10/site-packages/redis/client.py", line 632, in _execute_command return conn.retry.call_with_retry( File "/usr/lib/python3.10/site-packages/redis/retry.py", line 105, in call_with_retry return do() File "/usr/lib/python3.10/site-packages/redis/client.py", line 633, in <lambda> lambda: self._send_command_parse_response( File "/usr/lib/python3.10/site-packages/redis/client.py", line 604, in _send_command_parse_response return self.parse_response(conn, command_name, **options) File "/usr/lib/python3.10/site-packages/redis/client.py", line 664, in parse_response return self.response_callbacks[command_name](response, **options) TypeError: parse_sentinel_master() got an unexpected keyword argument 'return_responses'

Minimal Reproduction

repro.py
Traceback (most recent call last): File "/home/user/test-redispy/testbug.py", line 13, in <module> print(conn.sentinel_master("mymaster")) File "/usr/lib/python3.10/site-packages/redis/commands/sentinel.py", line 31, in sentinel_master return self.execute_command( File "/usr/lib/python3.10/site-packages/redis/client.py", line 621, in execute_command return self._execute_command(*args, **options) File "/usr/lib/python3.10/site-packages/redis/client.py", line 632, in _execute_command return conn.retry.call_with_retry( File "/usr/lib/python3.10/site-packages/redis/retry.py", line 105, in call_with_retry return do() File "/usr/lib/python3.10/site-packages/redis/client.py", line 633, in <lambda> lambda: self._send_command_parse_response( File "/usr/lib/python3.10/site-packages/redis/client.py", line 604, in _send_command_parse_response return self.parse_response(conn, command_name, **options) File "/usr/lib/python3.10/site-packages/redis/client.py", line 664, in parse_response return self.response_callbacks[command_name](response, **options) TypeError: parse_sentinel_master() got an unexpected keyword argument 'return_responses'

Environment

  • Python: 3.10

What Broke

Calling sentinel_master results in a TypeError, preventing successful execution of the command.

Why It Broke

The sentinel_master function calls execute_command with return_responses in **options, causing a TypeError

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install redis==7.1.0

When NOT to use: This fix should not be applied if the API behavior is expected to remain unchanged.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Option C — Workaround Temporary workaround

- Pin redis to <=`6.2.0`

When NOT to use: This fix should not be applied if the API behavior is expected to remain unchanged.

Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.

Fix reference: https://github.com/redis/redis-py/pull/3831

First fixed release: 7.1.0

Last verified: 2026-02-08. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix should not be applied if the API behavior is expected to remain unchanged.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Make timeouts explicit and test them (unit + integration) to avoid silent behavior changes.
  • Instrument retries (attempt count + reason) and alert on spikes to catch dependency slowdowns.

Version Compatibility Table

VersionStatus
7.1.0 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.