The Fix
pip install redis==7.1.0
Based on closed redis/redis-py issue #2325 · 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%.
@@ -87,6 +87,15 @@ class _Sentinel(enum.Enum):
"types, can't unload"
)
+# user send an AUTH cmd to a server without authorization configured
+NO_AUTH_SET_ERROR = {
+ # Redis >= 6.0
if __name__ == '__main__':
redis = RedisClient(
host="localhost",
port=6379,
socket_timeout=REDIS_SOCKET_TIMEOUT_SECONDS,
retry_on_timeout=True,
username="admin",
# actual password is different
password="random"
)
try:
val = redis.get("test")
except AuthenticationError as e:
print("I can't reach that code")
val = 0
print(val)
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: Do not apply this fix if using Redis versions older than 6.0.\n\n
Why This Fix Works in Production
- Trigger: WRONGPASS response doesn't raise AuthenticationError exception
- Mechanism: The WRONGPASS response raises a ResponseError instead of an AuthenticationError due to unhandled exceptions
- Why the fix works: Addresses the issue where the WRONGPASS response does not raise an AuthenticationError exception. (first fixed release: 7.1.0).
- 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.5.1 in real deployments (not just unit tests).
- The WRONGPASS response raises a ResponseError instead of an AuthenticationError due to unhandled exceptions
- Surfaces as: WRONGPASS response doesn't raise AuthenticationError exception
Proof / Evidence
- GitHub issue: #2325
- Fix PR: https://github.com/redis/redis-py/pull/2329
- First fixed release: 7.1.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-07
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.65
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“**Version**: What redis-py and what redis version is the issue happening on? redis-py 4.3.4 redis 6.3.6 **Platform**: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure) python 3.9 on macOS Monterey 12.0.”
Failure Signature (Search String)
- WRONGPASS response doesn't raise AuthenticationError exception
Error Message
Stack trace
Error Message
-------------
WRONGPASS response doesn't raise AuthenticationError exception
Minimal Reproduction
if __name__ == '__main__':
redis = RedisClient(
host="localhost",
port=6379,
socket_timeout=REDIS_SOCKET_TIMEOUT_SECONDS,
retry_on_timeout=True,
username="admin",
# actual password is different
password="random"
)
try:
val = redis.get("test")
except AuthenticationError as e:
print("I can't reach that code")
val = 0
print(val)
Environment
- Python: 3.5.1
What Broke
Users experience incorrect authentication handling leading to unexpected application behavior.
Why It Broke
The WRONGPASS response raises a ResponseError instead of an AuthenticationError due to unhandled exceptions
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install redis==7.1.0
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/2329
First fixed release: 7.1.0
Last verified: 2026-02-07. Validate in your environment.
When NOT to Use This Fix
- Do not apply this fix if using Redis versions older than 6.0.
Verify Fix
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
| Version | Status |
|---|---|
| 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.