Jump to solution
Verify

The Fix

pip install redis==7.1.0

Based on closed redis/redis-py issue #3390 · 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
@@ -58,11 +58,11 @@ # HIDE_END res7 = r.sinter("bikes:racing:france", "bikes:racing:usa") -print(res7) # >>> {'bike:1'} +print(res7) # >>> ['bike:1'] # STEP_END
repro.py
>> from redis import Redis >> pool = Redis.from_url("redis://", decode_responses=True) >> pool.sadd("users", "user1") 0 >> pool.smembers("users") {'user1'}
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 application relies on the list return type for `smembers`.\n\n

Why This Fix Works in Production

  • Trigger: **Description**: `smembers` is returning a list instead of a set in redis-py `5.1.0` which is an unintended breaking change.
  • Mechanism: The `smembers` command was unintentionally changed to return a list instead of a set due to a bug fix
  • Why the fix works: Addresses the unintended breaking change where `smembers` returns a list instead of a set in redis-py `5.1.0`. (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.11 in real deployments (not just unit tests).
  • The `smembers` command was unintentionally changed to return a list instead of a set due to a bug fix
  • Production symptom (often without a traceback): **Description**: `smembers` is returning a list instead of a set in redis-py `5.1.0` which is an unintended breaking change.

Proof / Evidence

  • GitHub issue: #3390
  • Fix PR: https://github.com/redis/redis-py/pull/3324
  • 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.74

Discussion

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

“@dmaier-redislabs Alright makes sense, thanks for the quick fix, I'll wait before updating. Closing this issue.”
@jules-ch · 2024-10-02 · confirmation · source
“Seems to be done in https://github.com/redis/redis-py/pull/3324#issue-2419053541 Can you add this in the list of the breaking changes in 5.1, it's not documented. Also stubs from…”
@jules-ch · 2024-09-28 · source
“Hi Jules, we had a note under bug fixes. I copied it over to the breaking changes section to make it more visible. Which RESP…”
@dmaier-redislabs · 2024-09-30 · source
“I did not specified RESP protocol version somewhere, is it tied to Redis server version ?”
@jules-ch · 2024-09-30 · source

Failure Signature (Search String)

  • **Description**: `smembers` is returning a list instead of a set in redis-py `5.1.0` which is an unintended breaking change.
  • Can you add this in the list of the breaking changes in 5.1, it's not documented.
Copy-friendly signature
signature.txt
Failure Signature ----------------- **Description**: `smembers` is returning a list instead of a set in redis-py `5.1.0` which is an unintended breaking change. Can you add this in the list of the breaking changes in 5.1, it's not documented.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- **Description**: `smembers` is returning a list instead of a set in redis-py `5.1.0` which is an unintended breaking change. Can you add this in the list of the breaking changes in 5.1, it's not documented.

Minimal Reproduction

repro.py
>> from redis import Redis >> pool = Redis.from_url("redis://", decode_responses=True) >> pool.sadd("users", "user1") 0 >> pool.smembers("users") {'user1'}

Environment

  • Python: 3.11

What Broke

Users experienced incorrect data types returned from the `smembers` command, leading to potential application errors.

Why It Broke

The `smembers` command was unintentionally changed to return a list instead of a set due to a bug fix

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 application relies on the list return type for `smembers`.

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

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

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 application relies on the list return type for `smembers`.

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

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

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.