The Fix
pip install urllib3==2.0.0a4
Based on closed urllib3/urllib3 issue #2975 · 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%.
@@ -98,7 +98,12 @@ jobs:
cache: "pip"
- - name: "Install dependencies"
+ - if: matrix.python-version == '2.7'
+ name: "Install dependencies"
nox > Running session unsupported_setup_py-2.7
nox > Creating virtual environment (virtualenv) using python2.7 in .nox/unsupported_setup_py-2-7
nox > Command /opt/hostedtoolcache/Python/3.11.3/x64/bin/python -m virtualenv /home/runner/work/urllib3/urllib3/.nox/unsupported_setup_py-2-7 -p python2.7 failed with exit code 1:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python2.7'
nox > Session unsupported_setup_py-2.7 failed.
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install urllib3==2.0.0a4\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: nox > Running session unsupported_setup_py-2.7
- Mechanism: Pins the virtualenv version to fix the Python 2.7 CI job failure.
- Why the fix works: Pins the virtualenv version to fix the Python 2.7 CI job failure. (first fixed release: 2.0.0a4).
- 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 in real deployments (not just unit tests).
- Surfaces as: nox > Running session unsupported_setup_py-2.7
Proof / Evidence
- GitHub issue: #2975
- Fix PR: https://github.com/urllib3/urllib3/pull/2977
- First fixed release: 2.0.0a4
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.48
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“the cause is https://virtualenv.pypa.io/en/latest/changelog.html#features-20-22-0 https://github.com/pypa/virtualenv/pull/2548”
Failure Signature (Search String)
- nox > Running session unsupported_setup_py-2.7
Error Message
Stack trace
Error Message
-------------
nox > Running session unsupported_setup_py-2.7
nox > Creating virtual environment (virtualenv) using python2.7 in .nox/unsupported_setup_py-2-7
nox > Command /opt/hostedtoolcache/Python/3.11.3/x64/bin/python -m virtualenv /home/runner/work/urllib3/urllib3/.nox/unsupported_setup_py-2-7 -p python2.7 failed with exit code 1:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python2.7'
nox > Session unsupported_setup_py-2.7 failed.
Minimal Reproduction
nox > Running session unsupported_setup_py-2.7
nox > Creating virtual environment (virtualenv) using python2.7 in .nox/unsupported_setup_py-2-7
nox > Command /opt/hostedtoolcache/Python/3.11.3/x64/bin/python -m virtualenv /home/runner/work/urllib3/urllib3/.nox/unsupported_setup_py-2-7 -p python2.7 failed with exit code 1:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python2.7'
nox > Session unsupported_setup_py-2.7 failed.
Environment
- Python: 2.7
What Broke
CI jobs fail to run, causing delays in testing and deployment.
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==2.0.0a4
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/urllib3/urllib3/pull/2977
First fixed release: 2.0.0a4
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use if it changes public behavior or if the failure cannot be reproduced.
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 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.
- 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.
Version Compatibility Table
| Version | Status |
|---|---|
| 2.0.0a4 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.