The Fix
pip install requests==2.27.0
Based on closed psf/requests issue #5824 · PR/commit linked
@@ -43,7 +43,8 @@ def run_tests(self):
'charset_normalizer~=2.0.0; python_version >= "3"',
'chardet>=3.0.2,<5; python_version < "3"',
- 'idna>=2.5,<3',
+ 'idna>=2.5,<3; python_version < "3"',
+ 'idna>=2.5,<4; python_version >= "3"',
Option A — Upgrade to fixed release\npip install requests==2.27.0\nWhen NOT to use: Do not use this fix if your application relies on idna versions below 3.0.\n\n
Why This Fix Works in Production
- Trigger: Like others, this is blocking some of my development. In particular, I wish to try https://github.com/karolyi/py3-validate-email, which requires `idna~=3.0`,…
- Mechanism: Bumps the idna version to allow for version 3.x to be installed, addressing issue #5710.
- Why the fix works: Bumps the idna version to allow for version 3.x to be installed, addressing issue #5710. (first fixed release: 2.27.0).
- If left unfixed, failures can be intermittent under concurrency (hard to reproduce; shows up as sporadic 5xx/timeouts).
Why This Breaks in Prod
- Production symptom (often without a traceback): Like others, this is blocking some of my development. In particular, I wish to try https://github.com/karolyi/py3-validate-email, which requires `idna~=3.0`, incompatible with the current requests requirements.
Proof / Evidence
- GitHub issue: #5824
- Fix PR: https://github.com/psf/requests/pull/5711
- First fixed release: 2.27.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.66
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Hi @dfrankow, As the last comments in both of those issues state (https://github.com/psf/requests/issues/5710#issuecomment-830211618) (https://github.com/psf/requests/pull/5711#issuecomment-764017260), this is likely to be included in the next release of…”
Failure Signature (Search String)
- Like others, this is blocking some of my development. In particular, I wish to try https://github.com/karolyi/py3-validate-email, which requires `idna~=3.0`, incompatible with the
Copy-friendly signature
Failure Signature
-----------------
Like others, this is blocking some of my development. In particular, I wish to try https://github.com/karolyi/py3-validate-email, which requires `idna~=3.0`, incompatible with the current requests requirements.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Like others, this is blocking some of my development. In particular, I wish to try https://github.com/karolyi/py3-validate-email, which requires `idna~=3.0`, incompatible with the current requests requirements.
What Broke
Blocking development due to incompatible idna version requirements.
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install requests==2.27.0
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/psf/requests/pull/5711
First fixed release: 2.27.0
Last verified: 2026-02-07. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if your application relies on idna versions below 3.0.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a stress test that runs high-concurrency workloads and fails on thread dumps / blocked locks.
- Enable watchdog dumps in prod (faulthandler, thread dump endpoint) to capture deadlocks quickly.
Version Compatibility Table
| Version | Status |
|---|---|
| 2.27.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.