The Fix
pip install requests==2.27.0
Based on closed psf/requests issue #5212 · 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%.
@@ -3,8 +3,8 @@
following:
-1. Read our [Contributor's Guide](http://docs.python-requests.org/en/latest/dev/contributing/).
-2. Understand our [development philosophy](http://docs.python-requests.org/en/latest/dev/philosophy/).
+1. Read our [Contributor's Guide](https://requests.readthedocs.io/en/latest/dev/contributing/).
>> import requests
>> requests.get('https://2.python-requests.org/')
Traceback (most recent call last):
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 472, in wrap_socket
cnx.do_handshake()
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1716, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1456, in _raise_ssl_error
_raise_current_error()
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert internal error')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn
conn.connect()
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connection.py", line 370, in connect
ssl_context=context)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 355, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 478, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert internal error')],)",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='2.python-requests.org', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert internal error')],)",),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/requests/sessions.py",
... (truncated) ...
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install requests==2.27.0\nWhen NOT to use: This fix is not applicable if the documentation needs to reference the old site for legacy support.\n\n
Why This Fix Works in Production
- Trigger: >> import requests
- Mechanism: The documentation contained outdated links that pointed to a non-existent HTTPS version of the site
- Why the fix works: Updated documentation links to point to requests.readthedocs.io instead of the deprecated 2.python-requests.org. (first fixed release: 2.27.0).
- 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.6 in real deployments (not just unit tests).
- The documentation contained outdated links that pointed to a non-existent HTTPS version of the site
- Surfaces as: >> import requests
Proof / Evidence
- GitHub issue: #5212
- Fix PR: https://github.com/psf/requests/pull/5236
- First fixed release: 2.27.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-07
- Confidence: 0.75
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.30
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Can you fix up the redirect from docs.pyhon-requests.org' so that it doesn't redirect to a URL that cannot work? http://docs.python-requests.org/en/master/objects.inv -> https://2.python-requests.org//en/master/objects.inv which now doesn't…”
“URL in readme was changed by @Leetcore https://github.com/psf/requests/commit/74b72ce4265583db0430080ab67d3d5e0c4b44b2 Closing this issue, as 2.python-requests.org is no longer mentioned anywhere in docs”
“Re-opening until @ssbarnea's pull request #5236 is merged, since there are a lot more links than I initially thought when I closed this issue”
“I moved the site to requests.kennethreitz.org, in preparation to it being requests.psf.org (or something similar, ideally).”
Failure Signature (Search String)
- >> import requests
Error Message
Stack trace
Error Message
-------------
>> import requests
>> requests.get('https://2.python-requests.org/')
Traceback (most recent call last):
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 472, in wrap_socket
cnx.do_handshake()
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1716, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1456, in _raise_ssl_error
_raise_current_error()
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert internal error')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionp
... (truncated) ...
Minimal Reproduction
>> import requests
>> requests.get('https://2.python-requests.org/')
Traceback (most recent call last):
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 472, in wrap_socket
cnx.do_handshake()
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1716, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1456, in _raise_ssl_error
_raise_current_error()
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert internal error')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn
conn.connect()
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connection.py", line 370, in connect
ssl_context=context)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 355, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 478, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert internal error')],)",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='2.python-requests.org', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert internal error')],)",),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib/python3.6/site-packages/requests/sessions.py",
... (truncated) ...
Environment
- Python: 3.6
What Broke
Users encountered broken links leading to a non-functional HTTPS site, causing confusion.
Why It Broke
The documentation contained outdated links that pointed to a non-existent HTTPS version of the site
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install requests==2.27.0
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/5236
First fixed release: 2.27.0
Last verified: 2026-02-07. Validate in your environment.
When NOT to Use This Fix
- This fix is not applicable if the documentation needs to reference the old site for legacy support.
Verify Fix
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 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.
- 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.
Version Compatibility Table
| Version | Status |
|---|---|
| 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.