Jump to solution
Details

The Fix

pip install requests==2.27.0

Based on closed psf/requests issue #5984 · 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
@@ -80,11 +80,11 @@ class TooManyRedirects(RequestException): class MissingSchema(RequestException, ValueError): - """The URL schema (e.g. http or https) is missing.""" + """The URL scheme (e.g. http or https) is missing."""
fix.md
Option A — Upgrade to fixed release\npip install requests==2.27.0\nWhen NOT to use: This fix should not be applied if the exception naming convention is critical for existing integrations.\n\n

Why This Fix Works in Production

  • Trigger: url "schema" should be "scheme"
  • Mechanism: The error message incorrectly referred to the URL 'schema' instead of 'scheme'
  • Why the fix works: Fixes the error message text for the incorrectly named '*Schema' exceptions, changing 'schema' to 'scheme'. (first fixed release: 2.27.0).
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 error message incorrectly referred to the URL 'schema' instead of 'scheme'
  • Production symptom (often without a traceback): url "schema" should be "scheme"

Proof / Evidence

  • GitHub issue: #5984
  • Fix PR: https://github.com/psf/requests/pull/6017
  • First fixed release: 2.27.0
  • 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).

“Hi @DanLipsitt, We agree the minomer isn't great and did address this in #2961 as you've noted. I'm open to reviewing a PR, although that…”
@nateprewitt · 2021-11-24 · source
“There's a backwards compatible way to change the exception class that's not great. The message is definitely safe to change though”
@sigmavirus24 · 2021-11-24 · source

Failure Signature (Search String)

  • url "schema" should be "scheme"
  • There's a backwards compatible way to change the exception class that's not great. The message is definitely safe to change though
Copy-friendly signature
signature.txt
Failure Signature ----------------- url "schema" should be "scheme" There's a backwards compatible way to change the exception class that's not great. The message is definitely safe to change though

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- url "schema" should be "scheme" There's a backwards compatible way to change the exception class that's not great. The message is definitely safe to change though

What Broke

Users encountered confusing error messages when providing URLs without a scheme.

Why It Broke

The error message incorrectly referred to the URL 'schema' instead of 'scheme'

Fix Options (Details)

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

pip install requests==2.27.0

When NOT to use: This fix should not be applied if the exception naming convention is critical for existing integrations.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/psf/requests/pull/6017

First fixed release: 2.27.0

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 the exception naming convention is critical for existing integrations.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Version Compatibility Table

VersionStatus
2.27.0 Fixed

Related Issues

No related fixes found.

Sources

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