Jump to solution
Verify

The Fix

pip install urllib3==1.26.13

Based on closed urllib3/urllib3 issue #2648 · 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
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@ +Modified ``urllib3.HTTPConnection.getresponse`` to return an instance of ``urllib3.HTTPResponse`` instead of ``http.client.HTTPResponse``. + +Removed ``urllib3.HTTPResponse.from_httplib``.
repro.py
def test_exceptions(): parser = ParseExceptions() parser.process_method(HTTPConnection.getresponse, module=http.client) assert parser.visited_nodes == 24489 print(parser.raw_exceptions) print(parser.found_exceptions)
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 urllib3==1.26.13\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: - [x] Research and understand which exceptions can be raised at which stage from `HTTPConnection.urlopen` and `HTTPConnection.getresponse` in both urllib3 and…
  • Mechanism: Refactor internal APIs to use urllib3.HTTPResponse instead of http.client.HTTPResponse.
  • Why the fix works: Refactor internal APIs to use urllib3.HTTPResponse instead of http.client.HTTPResponse. (first fixed release: 1.26.13).
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

  • Production symptom (often without a traceback): - [x] Research and understand which exceptions can be raised at which stage from `HTTPConnection.urlopen` and `HTTPConnection.getresponse` in both urllib3 and http.client. This research should be posted into this issue.

Proof / Evidence

  • GitHub issue: #2648
  • Fix PR: https://github.com/urllib3/urllib3/pull/2649
  • First fixed release: 1.26.13
  • 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.66

Discussion

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

“@shadycuz It sounds like you're on the right path!”
@sethmlarson · 2022-06-21 · source
“@sethmlarson > Research and understand which exceptions can be raised at which stage from HTTPConnection.urlopen and HTTPConnection.getresponse in both urllib3 and http.client”
@shadycuz · 2022-07-30 · source
“I think super is mostly fixed? I can't remember. Still need to fix the bare raise bug. I did publish the first tool Deep-AST that…”
@shadycuz · 2022-10-04 · source
“@sethmlarson I'm too lazy to do the reaserch on the exceptions..”
@shadycuz · 2022-08-02 · source

Failure Signature (Search String)

  • - [x] Research and understand which exceptions can be raised at which stage from `HTTPConnection.urlopen` and `HTTPConnection.getresponse` in both urllib3 and http.client. This
  • - [x] Change existing test cases for the new logic.
Copy-friendly signature
signature.txt
Failure Signature ----------------- - [x] Research and understand which exceptions can be raised at which stage from `HTTPConnection.urlopen` and `HTTPConnection.getresponse` in both urllib3 and http.client. This research should be posted into this issue. - [x] Change existing test cases for the new logic.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- - [x] Research and understand which exceptions can be raised at which stage from `HTTPConnection.urlopen` and `HTTPConnection.getresponse` in both urllib3 and http.client. This research should be posted into this issue. - [x] Change existing test cases for the new logic.

Minimal Reproduction

repro.py
def test_exceptions(): parser = ParseExceptions() parser.process_method(HTTPConnection.getresponse, module=http.client) assert parser.visited_nodes == 24489 print(parser.raw_exceptions) print(parser.found_exceptions)

What Broke

Applications relying on urllib3 received incompatible response types, causing errors.

Fix Options (Details)

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

pip install urllib3==1.26.13

When NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.

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

First fixed release: 1.26.13

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use if it changes public behavior or if the failure cannot be reproduced.

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

  • 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.
  • Track RSS + object counts after deployments; alert on monotonic growth and GC pressure.
  • Add a long-running test that repeats the failing call path and asserts stable memory.

Version Compatibility Table

VersionStatus
1.26.13 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.