Jump to solution
Details

The Fix

Fixes the DeprecationWarning related to the strict argument in HTTPConnection by removing it for Python 3 compatibility. It resolves issue #342.

Based on closed urllib3/urllib3 issue #342 · 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
@@ -9,3 +9,4 @@ install: notifications: email: false +env: PYTHONWARNINGS=always::DeprecationWarning diff --git a/test/__init__.py b/test/__init__.py index a9f19e2eb4..a9d950dcee 100644
fix.md
Option A — Apply the official fix\nFixes the DeprecationWarning related to the strict argument in HTTPConnection by removing it for Python 3 compatibility. It resolves issue #342.\nWhen NOT to use: This fix is not safe if strict behavior is required for compatibility with older servers.\n\n

Why This Fix Works in Production

  • Trigger: When using requests which includes urllib3 I get this deprecationwarning that traces back to connection.py.
  • Mechanism: The strict argument in HTTPConnection is deprecated in Python 3, causing warnings
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 strict argument in HTTPConnection is deprecated in Python 3, causing warnings
  • Production symptom (often without a traceback): When using requests which includes urllib3 I get this deprecationwarning that traces back to connection.py.

Proof / Evidence

Discussion

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

“Mmmm looks like a regression of #238/#239. :( We need to add a test/configuration to break on DeprecationWarning which travisci would ideally catch under py3.”
@shazow · 2014-02-21 · source
“@Kruptein Could you give me a quick sanity check before I merge? Here's my PR: #343”
@shazow · 2014-02-21 · source
“Sorry, my github notifications were set up wrong :) Now, it seems that that solved the error, I don't get any warnings anymore and my…”
@Kruptein · 2014-02-22 · source

Failure Signature (Search String)

  • When using requests which includes urllib3 I get this deprecationwarning that traces back to connection.py.
  • It doesn't break code but just clutters logs.
Copy-friendly signature
signature.txt
Failure Signature ----------------- When using requests which includes urllib3 I get this deprecationwarning that traces back to connection.py. It doesn't break code but just clutters logs.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- When using requests which includes urllib3 I get this deprecationwarning that traces back to connection.py. It doesn't break code but just clutters logs.

What Broke

Deprecation warnings clutter logs during requests using urllib3.

Why It Broke

The strict argument in HTTPConnection is deprecated in Python 3, causing warnings

Fix Options (Details)

Option A — Apply the official fix

Fixes the DeprecationWarning related to the strict argument in HTTPConnection by removing it for Python 3 compatibility. It resolves issue #342.

When NOT to use: This fix is not safe if strict behavior is required for compatibility with older servers.

Fix reference: https://github.com/urllib3/urllib3/pull/343

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

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not safe if strict behavior is required for compatibility with older servers.

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.

Related Issues

No related fixes found.

Sources

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