Jump to solution
Details

The Fix

pip install urllib3==1.26.9

Based on closed urllib3/urllib3 issue #2543 · PR/commit linked

Open PR/Commit
@@ -117,7 +117,7 @@ jobs: python -m coverage combine python -m coverage html --skip-covered --skip-empty - python -m coverage report -i --fail-under=100 + python -m coverage report --ignore-errors --show-missing --fail-under=100
fix.md
Option A — Upgrade to fixed release\npip install urllib3==1.26.9\nWhen NOT to use: This fix is not suitable if complete coverage is required without exceptions.\n\n

Why This Fix Works in Production

  • Trigger: [1.26] Coverage dropped below 100% when vendoring ssl_match_hostname
  • Mechanism: Coverage report command did not show missing lines due to incorrect flags
  • Why the fix works: Addresses the coverage drop by modifying the coverage report command to show missing lines. (first fixed release: 1.26.9).
Production impact:
  • If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).

Why This Breaks in Prod

  • Coverage report command did not show missing lines due to incorrect flags
  • Production symptom (often without a traceback): [1.26] Coverage dropped below 100% when vendoring ssl_match_hostname

Proof / Evidence

  • GitHub issue: #2543
  • Fix PR: https://github.com/urllib3/urllib3/pull/2540
  • First fixed release: 1.26.9
  • 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.69

Discussion

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

“Thanks @pquentin for the issue”
@hramezani · 2022-01-20 · source
“@pquentin I think we can close this now!”
@hramezani · 2022-01-30 · source
“To cover UnicodeError except: https://github.com/urllib3/urllib3/blob/b1f60e44d43b13e5272d5b6003f125af9c25c8ad/src/urllib3/util/ssl_match_hostname.py#L118-L122 As UnicodeError is a subclass of ValueError, and in both except blocks we have host_ip = None, I wou”
@hramezani · 2022-01-21 · source

Failure Signature (Search String)

  • [1.26] Coverage dropped below 100% when vendoring ssl_match_hostname
  • https://github.com/urllib3/urllib3/blob/b1f60e44d43b13e5272d5b6003f125af9c25c8ad/src/urllib3/util/ssl_match_hostname.py#L118-L122
Copy-friendly signature
signature.txt
Failure Signature ----------------- [1.26] Coverage dropped below 100% when vendoring ssl_match_hostname https://github.com/urllib3/urllib3/blob/b1f60e44d43b13e5272d5b6003f125af9c25c8ad/src/urllib3/util/ssl_match_hostname.py#L118-L122

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- [1.26] Coverage dropped below 100% when vendoring ssl_match_hostname https://github.com/urllib3/urllib3/blob/b1f60e44d43b13e5272d5b6003f125af9c25c8ad/src/urllib3/util/ssl_match_hostname.py#L118-L122

Why It Broke

Coverage report command did not show missing lines due to incorrect flags

Fix Options (Details)

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

pip install urllib3==1.26.9

When NOT to use: This fix is not suitable if complete coverage is required without exceptions.

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

First fixed release: 1.26.9

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 complete coverage is required without exceptions.

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.
  • Add a TLS smoke test that performs a real handshake in CI (include CA bundle validation and hostname checks).
  • Alert on handshake failures by error string and endpoint to catch cert/CA changes quickly.

Version Compatibility Table

VersionStatus
1.26.9 Fixed

Related Issues

No related fixes found.

Sources

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