Jump to solution
Details

The Fix

pip install urllib3==1.26.8

Based on closed urllib3/urllib3 issue #2252 · 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%.

Open PR/Commit
@@ -26,6 +26,7 @@ from .util.proxy import create_proxy_ssl_context +from .util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT, Timeout from .util.util import to_bytes, to_str
fix.md
Option A — Upgrade to fixed release\npip install urllib3==1.26.8\nWhen NOT to use: This fix is not suitable if backward compatibility with older type checks is required.\n\n

Why This Fix Works in Production

  • Trigger: Investigate removing `object` from the `Union[...]` of many `timeout` types
  • Mechanism: The presence of 'object' in the Union of timeout types caused type issues
  • Why the fix works: Removes `object` from the `Union[...]` of timeout types and adds a sentinel type for default timeouts compatible with Mypy. (first fixed release: 1.26.8).
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 presence of 'object' in the Union of timeout types caused type issues
  • Production symptom (often without a traceback): Investigate removing `object` from the `Union[...]` of many `timeout` types

Proof / Evidence

  • GitHub issue: #2252
  • Fix PR: https://github.com/urllib3/urllib3/pull/2473
  • First fixed release: 1.26.8
  • 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.71

Discussion

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

“Related discussion: https://github.com/encode/httpx/issues/1384”
@pquentin · 2021-06-04 · source
“I've tested it on my own setup. by removing object, we will have to add 9 type: ignore and 9 type: ignore will be removed.…”
@hramezani · 2021-07-28 · source

Failure Signature (Search String)

  • Investigate removing `object` from the `Union[...]` of many `timeout` types
  • It's causing a lot of problems type-wise when going from urllib3 timeout to http.client timeouts, let's take a peek if we can instead remove `object` and add `type: ignore` only
Copy-friendly signature
signature.txt
Failure Signature ----------------- Investigate removing `object` from the `Union[...]` of many `timeout` types It's causing a lot of problems type-wise when going from urllib3 timeout to http.client timeouts, let's take a peek if we can instead remove `object` and add `type: ignore` only where the socket default timeout sentinel is used.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Investigate removing `object` from the `Union[...]` of many `timeout` types It's causing a lot of problems type-wise when going from urllib3 timeout to http.client timeouts, let's take a peek if we can instead remove `object` and add `type: ignore` only where the socket default timeout sentinel is used.

Why It Broke

The presence of 'object' in the Union of timeout types caused type issues

Fix Options (Details)

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

pip install urllib3==1.26.8

When NOT to use: This fix is not suitable if backward compatibility with older type checks is required.

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

First fixed release: 1.26.8

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

  • This fix is not suitable if backward compatibility with older type checks is required.

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.
  • 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
1.26.8 Fixed

Related Issues

No related fixes found.

Sources

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