The Fix
pip install urllib3==1.26.1
Based on closed urllib3/urllib3 issue #2045 · 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%.
@@ -43,6 +43,7 @@ class BrokenPipeError(Exception):
+from ._collections import HTTPHeaderDict # noqa (historical, removed in v2)
from ._version import __version__
from .exceptions import (
Option A — Upgrade to fixed release\npip install urllib3==1.26.1\nWhen NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.\n\n
Why This Fix Works in Production
- Trigger: Broken import for HTTPHeaderDict in 1.26.0
- Mechanism: Restores the import of HTTPHeaderDict from 1.25.x to resolve import errors in version 1.26.0.
- Why the fix works: Restores the import of HTTPHeaderDict from 1.25.x to resolve import errors in version 1.26.0. (first fixed release: 1.26.1).
- 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
- Production symptom (often without a traceback): Broken import for HTTPHeaderDict in 1.26.0
Proof / Evidence
- GitHub issue: #2045
- Fix PR: https://github.com/urllib3/urllib3/pull/2046
- First fixed release: 1.26.1
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.60
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“HTTPHeaderDict isn't *supposed* to be a public class (hence being defined in _collections). The import of HTTPHeaderDict in urllib3.response is likely more stable but there…”
“> Is there a more stable package we should be importing HTTPHeaderDict from? This passive aggressive tact is unnecessary.”
“I've opened https://github.com/urllib3/urllib3/pull/2046 against 1.26 to relieve your users pain over this issue, however this import will not work in v2.”
“> This passive aggressive tact is unnecessary”
Failure Signature (Search String)
- Broken import for HTTPHeaderDict in 1.26.0
- [Responses](https://github.com/getsentry/responses) has historically used `from urllib3.connection import HTTPHeaderDict` but that import is now failing in 1.26.0. Looking through
Copy-friendly signature
Failure Signature
-----------------
Broken import for HTTPHeaderDict in 1.26.0
[Responses](https://github.com/getsentry/responses) has historically used `from urllib3.connection import HTTPHeaderDict` but that import is now failing in 1.26.0. Looking through the history this was changed as part of #2018
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Broken import for HTTPHeaderDict in 1.26.0
[Responses](https://github.com/getsentry/responses) has historically used `from urllib3.connection import HTTPHeaderDict` but that import is now failing in 1.26.0. Looking through the history this was changed as part of #2018
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==1.26.1
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/urllib3/urllib3/pull/2046
First fixed release: 1.26.1
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use if it changes public behavior or if the failure cannot be reproduced.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.26.1 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.