Jump to solution
Verify

The Fix

pip install redis==7.1.0

Based on closed redis/redis-py issue #845 · 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
@@ -1,6 +1,12 @@ @@ -1,6 +1,12 @@ """Internal module for Python 2 backwards compatibility.""" +import errno import sys
repro.py
# For Python older than 3.5, retry EINTR. if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 5): # Adapted from https://bugs.python.org/review/23863/patch/14532/54418 import socket import time import errno from select import select as _select def select(rlist, wlist, xlist, timeout): while True: try: return _select(rlist, wlist, xlist, timeout) except InterruptedError: continue
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 apply this fix if targeting only Python 3 environments.\n\n

Why This Fix Works in Production

  • Trigger: redis._compat: global name 'InterruptedError' is not defined
  • Mechanism: The code uses 'InterruptedError', which is not defined in Python 2
  • Why the fix works: Defined `InterruptedError` as `OSError` if not defined like in Python 2, fixing compatibility issues. (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

  • The code uses 'InterruptedError', which is not defined in Python 2
  • Surfaces as: redis._compat: global name 'InterruptedError' is not defined

Proof / Evidence

  • GitHub issue: #845
  • Fix PR: https://github.com/redis/redis-py/pull/846
  • 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.57

Discussion

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

“@gjcarneiro See #846 and help review this change.”
@sethmlarson · 2017-03-23 · source

Failure Signature (Search String)

  • redis._compat: global name 'InterruptedError' is not defined

Error Message

Stack trace
error.txt
Error Message ------------- redis._compat: global name 'InterruptedError' is not defined

Minimal Reproduction

repro.py
# For Python older than 3.5, retry EINTR. if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 5): # Adapted from https://bugs.python.org/review/23863/patch/14532/54418 import socket import time import errno from select import select as _select def select(rlist, wlist, xlist, timeout): while True: try: return _select(rlist, wlist, xlist, timeout) except InterruptedError: continue

What Broke

The application fails to handle interrupted system calls in Python 2, causing unexpected behavior.

Why It Broke

The code uses 'InterruptedError', which is not defined in Python 2

Fix Options (Details)

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

pip install redis==7.1.0

When NOT to use: Do not apply this fix if targeting only Python 3 environments.

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

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 apply this fix if targeting only Python 3 environments.

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.