Jump to solution
Verify

The Fix

pip install urllib3==1.25.4

Based on closed urllib3/urllib3 issue #3081 · 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
@@ -9,6 +9,11 @@ dev (master) explicitly opted out of. (Pull #1607) +* Remove dependency on ``rfc3986`` for URL parsing. + +* Fix issue where URLs containing invalid characters within ``Url.auth`` would
repro.py
>> print("OS", platform.platform()) OS Linux-6.3.8-zen1-1-zen-x86_64-with-glibc2.37 >> print("Python", platform.python_version()) Python 3.11.2 >> print(ssl.OPENSSL_VERSION) OpenSSL 3.1.1 30 May 2023 >> print("urllib3", urllib3.__version__) urllib3 2.0.3
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.25.4\nWhen NOT to use: This fix should not be applied if strict adherence to RFC 3986 is required.\n\n

Why This Fix Works in Production

  • Trigger: Urllib3 changes the case of hex letters in percent encodings
  • Mechanism: Urllib3 incorrectly normalizes hex letters in percent encodings to uppercase when parsing URLs
  • Why the fix works: Removes the dependency on rfc3986 for URL parsing and fixes an issue where URLs containing invalid characters within Url.auth would raise an exception instead of percent-encoding those characters. (first fixed release: 1.25.4).
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

  • Shows up under Python 3.11.2 in real deployments (not just unit tests).
  • Urllib3 incorrectly normalizes hex letters in percent encodings to uppercase when parsing URLs
  • Production symptom (often without a traceback): Urllib3 changes the case of hex letters in percent encodings

Proof / Evidence

  • GitHub issue: #3081
  • Fix PR: https://github.com/urllib3/urllib3/pull/1647
  • First fixed release: 1.25.4
  • 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.72

Discussion

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

“This function probably is the culprit: https://github.com/urllib3/urllib3/blob/10ceef1c8944a55b51ad53651998c8aa9caedacb/src/urllib3/util/url.py#L227-L260 Called from here: https://github.com/urllib3/urllib3/blob/10ceef1c8944a55b51ad53651998c8aa9caedacb/src/url”
@MrQubo · 2023-06-28 · confirmation · source
“However we're not providing a general purpose URL parser but an HTTP client.”
@pquentin · 2023-07-14 · source
“We're following RFC 3986 when we normalize percent-encoded bytes and we likely won't change this position, even adding an option to do so doesn't feel…”
@sethmlarson · 2023-07-08 · source
“What I understood from the code is that urllib3 assumes that http and https are normalizable schemes and this normalization can be safely done in…”
@MrQubo · 2023-06-28 · source

Failure Signature (Search String)

  • Urllib3 changes the case of hex letters in percent encodings
  • Urllib3 changes the case of hex letters in percent encodings when parsing URLs.
Copy-friendly signature
signature.txt
Failure Signature ----------------- Urllib3 changes the case of hex letters in percent encodings Urllib3 changes the case of hex letters in percent encodings when parsing URLs.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Urllib3 changes the case of hex letters in percent encodings Urllib3 changes the case of hex letters in percent encodings when parsing URLs.

Minimal Reproduction

repro.py
>> print("OS", platform.platform()) OS Linux-6.3.8-zen1-1-zen-x86_64-with-glibc2.37 >> print("Python", platform.python_version()) Python 3.11.2 >> print(ssl.OPENSSL_VERSION) OpenSSL 3.1.1 30 May 2023 >> print("urllib3", urllib3.__version__) urllib3 2.0.3

Environment

  • Python: 3.11.2
  • urllib3: 2.0.3

What Broke

Users experience unexpected URL encoding behavior, leading to potential issues with URL handling.

Why It Broke

Urllib3 incorrectly normalizes hex letters in percent encodings to uppercase when parsing URLs

Fix Options (Details)

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

pip install urllib3==1.25.4

When NOT to use: This fix should not be applied if strict adherence to RFC 3986 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/1647

First fixed release: 1.25.4

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 should not be applied if strict adherence to RFC 3986 is required.

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

Related Issues

No related fixes found.

Sources

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