1.7 KiB
Title: urllib3-future .pth hook can leave urllib3 broken after installation
Description:
We observed environments where installing urllib3-future (or packages
that depend on it, such as niquests) leaves a .pth file in site-packages
that overrides urllib3 in a way that removes expected attributes (e.g.:
__version__, exceptions) and causes import-time failures in downstream
projects (e.g., No module named 'urllib3.exceptions').
Steps to reproduce (rough):
- Install
urllib3andurllib3-future(or a package that depends on it) - Observe that
import urllib3may succeed buturllib3.exceptionsorurllib3.__version__are missing, orimportlib.util.find_spec('urllib3.exceptions')returnsNone.
Impact:
- Downstream packages that expect modern
urllib3behavior break in subtle ways at import time.
Suggested actions for upstream:
- Avoid using a
.pththat replaces or mutates theurllib3package in-place, or ensure it keeps the originalurllib3semantics intact (i.e., do not create a namespace that hides core attributes/members). - Provide clear upgrade/migration notes for hosts that may have mixed
urllib3andurllib3-futureinstalled.
Notes / local workaround:
-
In our project we implemented a startup compatibility check and fail-fast guidance that suggests running:
python -m pip uninstall urllib3-future -y python -m pip install --upgrade --force-reinstall urllib3 python -m pip install niquests -U
and we added CI smoke tests and bootstrap verification so the problem is caught during setup rather than later at runtime.
Please consider this a friendly bug report and feel free to ask for any additional diagnostics or reproduction details.