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%.
@@ -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
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
- 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
- GitHub issue: #342
- Fix PR: https://github.com/urllib3/urllib3/pull/343
- Reproduced locally: No (not executed)
- Last verified: 2026-02-12
- Confidence: 0.80
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.80
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.”
“@Kruptein Could you give me a quick sanity check before I merge? Here's my PR: #343”
“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…”
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
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 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.
Fix reference: https://github.com/urllib3/urllib3/pull/343
Last verified: 2026-02-12. Validate in your environment.
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.