The Fix
pip install redis==4.3.3
Based on closed redis/redis-py issue #2209 · 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%.
@@ -77,7 +77,6 @@ def __init__(
redis,
name: str,
- *,
timeout: Optional[Number] = None,
sleep: Number = 0.1,
from redis import Redis
from redis.lock import Lock
def main():
r = Redis("localhost:6379")
Lock(r, "schlage", None)
if __name__ == "__main__":
main()
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==4.3.3\nWhen NOT to use: This fix should not be applied if maintaining backward compatibility with existing positional argument usage is required.\n\n
Why This Fix Works in Production
- Trigger: redis432 ❯ python nope.py
- Mechanism: The Lock class constructor changed to require keyword-only arguments, causing TypeErrors with positional arguments
- Why the fix works: Fixes a backward compatibility issue in the Lock class introduced in version 4.3.2, resolving the TypeError when using positional arguments. (first fixed release: 4.3.3).
- 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.9 in real deployments (not just unit tests).
- The Lock class constructor changed to require keyword-only arguments, causing TypeErrors with positional arguments
- Surfaces as: redis432 ❯ python nope.py
Proof / Evidence
- GitHub issue: #2209
- Fix PR: https://github.com/redis/redis-py/pull/2210
- First fixed release: 4.3.3
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.68
Verified Execution
We executed the runnable minimal repro in a temporary environment and captured exit codes + logs.
- Status: PASS
- Ran: 2026-02-11T16:52:29Z
- Package: redis
- Fixed: 4.3.3
- Mode: fixed_only
- Outcome: ok
Logs
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“@sgg Sorry, this backward happened unintentionally and fixed in 4.3.3. Thank you for reporting this.”
“@dvora-h No worries, thanks for the fast fix. You may want to yank the 4.3.2 release on PyPI to prevent others from running into this.…”
“PR #2137 changed also the signature of Lock.acquire() to accept only keyword arguments, so maybe that should be noted as a backward incompatibility note somewhere.”
“oh this is weird, here I was fixing it in dogpile.”
Failure Signature (Search String)
- redis432 ❯ python nope.py
Error Message
Stack trace
Error Message
-------------
redis432 ❯ python nope.py
Traceback (most recent call last):
File "nope.py", line 9, in <module>
main()
File "nope.py", line 6, in main
Lock(r, "schlage", None)
TypeError: __init__() takes 3 positional arguments but 4 were given
Minimal Reproduction
from redis import Redis
from redis.lock import Lock
def main():
r = Redis("localhost:6379")
Lock(r, "schlage", None)
if __name__ == "__main__":
main()
Environment
- Python: 3.9
Why It Broke
The Lock class constructor changed to require keyword-only arguments, causing TypeErrors with positional arguments
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install redis==4.3.3
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/2210
First fixed release: 4.3.3
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if maintaining backward compatibility with existing positional argument usage is required.
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
- 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
| Version | Status |
|---|---|
| 4.3.3 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.