Jump to solution
Verify

The Fix

pip install redis==7.1.0

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

Jump to Verify Open PR/Commit
@@ -97,6 +97,7 @@ def acl_genpass(self, bits: Union[int, None] = None, **kwargs) -> ResponseT: if b < 0 or b > 4096: raise ValueError + pieces.append(b) except ValueError: raise DataError(
repro.py
from redis import Redis url = "redis://localhost:6379/1" rdb = Redis.from_url(url) print(rdb.acl_genpass(32))
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: Do not use this fix if you require the previous behavior of acl_genpass.\n\n

Why This Fix Works in Production

  • Trigger: raise ValueError
  • Mechanism: The acl_genpass method did not correctly handle the bits argument, leading to unexpected password lengths
  • Why the fix works: Fixes the acl_genpass method to correctly handle the bits argument. (first fixed release: 7.1.0).

Why This Breaks in Prod

  • The acl_genpass method did not correctly handle the bits argument, leading to unexpected password lengths
  • Production symptom (often without a traceback): raise ValueError

Proof / Evidence

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

Discussion

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

“Thanks for wanting to report an issue you've found in redis-py. Please delete this text and fill in the template below. It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to have as muc”
Issue thread · issue description · source

Failure Signature (Search String)

  • raise ValueError
  • except ValueError:
Copy-friendly signature
signature.txt
Failure Signature ----------------- raise ValueError except ValueError:

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- raise ValueError except ValueError:

Minimal Reproduction

repro.py
from redis import Redis url = "redis://localhost:6379/1" rdb = Redis.from_url(url) print(rdb.acl_genpass(32))

What Broke

Users received passwords of incorrect lengths when calling acl_genpass with specific bit values.

Why It Broke

The acl_genpass method did not correctly handle the bits argument, leading to unexpected password lengths

Fix Options (Details)

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

pip install redis==7.1.0

When NOT to use: Do not use this fix if you require the previous behavior of acl_genpass.

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/3062

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

  • Do not use this fix if you require the previous behavior of acl_genpass.

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.