Jump to solution
Verify

The Fix

pip install urllib3==1.26.13

Based on closed urllib3/urllib3 issue #2826 · 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%.

Jump to Verify Open PR/Commit
@@ -12,7 +12,7 @@ pytest-freezegun==0.4.2 trustme==0.7.0 cryptography==3.2.1;python_version<"3.6" -cryptography==3.4.7;python_version>="3.6" +cryptography==38.0.3;python_version>="3.6" python-dateutil==2.8.1
repro.py
Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/cmd/build.py", line 280, in build_main args.pdb) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/application.py", line 219, in __init__ self.setup_extension(extension) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/application.py", line 398, in setup_extension self.registry.load_extension(self, extname) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/registry.py", line 459, in load_extension mod = import_module(extname) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/builders/linkcheck.py", line 18, in <module> from requests import Response File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/requests/__init__.py", line 49, in <module> from .packages.urllib3.contrib import pyopenssl File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 46, in <module> import OpenSSL.SSL File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/OpenSSL/__init__.py", line 8, in <module> from OpenSSL import SSL, crypto File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/OpenSSL/SSL.py", line 19, in <module> from OpenSSL.crypto import ( File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/OpenSSL/crypto.py", line 3232, in <module> name="load_pkcs7_data", TypeError: deprecated() got an unexpected keyword argument 'name' Exception occurred: File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/OpenSSL/crypto.py", line 3232, in <module> name="load_pkcs7_data", TypeError: deprecated() got an unexpected keyword argument 'name'
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install urllib3==1.26.13\nWhen NOT to use: Do not apply if using a version of cryptography incompatible with pyOpenSSL.\n\n

Why This Fix Works in Production

  • Trigger: args.pdb)
  • Mechanism: Incompatible cryptography version causing documentation build failures
  • Why the fix works: Bump cryptography to fix documentation build issues caused by incompatible versions. (first fixed release: 1.26.13).
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 3.7 in real deployments (not just unit tests).
  • Incompatible cryptography version causing documentation build failures
  • Surfaces as: Traceback (most recent call last):

Proof / Evidence

  • GitHub issue: #2826
  • Fix PR: https://github.com/urllib3/urllib3/pull/2827
  • First fixed release: 1.26.13
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.95
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.28

Discussion

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

“Closed in https://github.com/urllib3/urllib3/pull/2827”
@sethmlarson · 2022-11-23 · source

Failure Signature (Search String)

  • args.pdb)

Error Message

Stack trace
error.txt
Error Message ------------- Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/cmd/build.py", line 280, in build_main args.pdb) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/application.py", line 219, in __init__ self.setup_extension(extension) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/application.py", line 398, in setup_extension self.registry.load_extension(self, extname) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/registry.py", line 459, in load_extension mod = import_module(extname) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_ ... (truncated) ...

Minimal Reproduction

repro.py
Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/cmd/build.py", line 280, in build_main args.pdb) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/application.py", line 219, in __init__ self.setup_extension(extension) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/application.py", line 398, in setup_extension self.registry.load_extension(self, extname) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/registry.py", line 459, in load_extension mod = import_module(extname) File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/sphinx/builders/linkcheck.py", line 18, in <module> from requests import Response File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/requests/__init__.py", line 49, in <module> from .packages.urllib3.contrib import pyopenssl File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 46, in <module> import OpenSSL.SSL File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/OpenSSL/__init__.py", line 8, in <module> from OpenSSL import SSL, crypto File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/OpenSSL/SSL.py", line 19, in <module> from OpenSSL.crypto import ( File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/OpenSSL/crypto.py", line 3232, in <module> name="load_pkcs7_data", TypeError: deprecated() got an unexpected keyword argument 'name' Exception occurred: File "/home/docs/checkouts/readthedocs.org/user_builds/urllib3/envs/2825/lib/python3.7/site-packages/OpenSSL/crypto.py", line 3232, in <module> name="load_pkcs7_data", TypeError: deprecated() got an unexpected keyword argument 'name'

Environment

  • Python: 3.7

What Broke

Documentation builds fail due to TypeError in OpenSSL.

Why It Broke

Incompatible cryptography version causing documentation build failures

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install urllib3==1.26.13

When NOT to use: Do not apply if using a version of cryptography incompatible with pyOpenSSL.

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/2827

First fixed release: 1.26.13

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

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not apply if using a version of cryptography incompatible with pyOpenSSL.

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

  • 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

VersionStatus
1.26.13 Fixed

Related Issues

No related fixes found.

Sources

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