Jump to solution
Verify

The Fix

This was [fixed in CPython 3.10]( and thus in both urllib3 and Requests.

Based on closed psf/requests issue #4884

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
repro.py
>> import requests >> proxies = { 'https': 'https://someproxy:443' } >> requests.get('https://www.google.com', proxies=proxies) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 475, in request resp = self.send(prep, **send_kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 596, in send r = adapter.send(request, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 485, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', error(54, 'Connection reset by peer')))
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Apply the official fix\nThis was [fixed in CPython 3.10]( and thus in both urllib3 and Requests.\nWhen NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.\n\n

Why This Fix Works in Production

  • Trigger: >> import requests
  • Mechanism: This was [fixed in CPython 3.10]( and thus in both urllib3 and Requests.
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 2.7.11 in real deployments (not just unit tests).
  • Surfaces as: >> import requests

Proof / Evidence

  • GitHub issue: #4884
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-04
  • Confidence: 0.00
  • Did this fix it?: No (no upstream fix linked)
  • Own content ratio: 0.24

Discussion

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

“This was fixed in CPython 3.10 and thus in both urllib3 and Requests.”
@sethmlarson · 2021-11-28 · confirmation · source
“This is an issue with urllib3, maybe we can use that new issue moving feature! :)”
@sethmlarson · 2018-11-28 · source
“@SethMichaelLarson I gave it a whirl but it looks like we can only move between repos in this org. @brad-anton would you mind making an…”
@nateprewitt · 2018-11-29 · source
“Shame, I was looking forward to exchanging so many issues back and forth with our sister project. :)”
@sethmlarson · 2018-11-29 · source

Failure Signature (Search String)

  • >> import requests

Error Message

Stack trace
error.txt
Error Message ------------- >> import requests >> proxies = { 'https': 'https://someproxy:443' } >> requests.get('https://www.google.com', proxies=proxies) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 475, in request resp = self.send(prep, **send_kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 596, in send r = adapter.send(request, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 485, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', error(54, 'Connection reset by peer')))

Minimal Reproduction

repro.py
>> import requests >> proxies = { 'https': 'https://someproxy:443' } >> requests.get('https://www.google.com', proxies=proxies) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 70, in get return request('get', url, params=params, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 475, in request resp = self.send(prep, **send_kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 596, in send r = adapter.send(request, **kwargs) File "/Users/user/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 485, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', error(54, 'Connection reset by peer')))

Environment

  • Python: 2.7.11

Fix Options (Details)

Option A — Apply the official fix

This was [fixed in CPython 3.10]( and thus in both urllib3 and Requests.

When NOT to use: Do not use if it changes public behavior or if the failure cannot be reproduced.

Fix reference: https://github.com/psf/requests/issues/4884

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use if it changes public behavior or if the failure cannot be reproduced.

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

  • Track RSS + object counts after deployments; alert on monotonic growth and GC pressure.
  • Add a long-running test that repeats the failing call path and asserts stable memory.

Related Issues

No related fixes found.

Sources

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