2 Debian and other distributions "unbundle" requests' vendored dependencies, and
3 rewrite all imports to use the global versions of ``urllib3`` and ``chardet``.
4 The problem with this is that not only requests itself imports those
5 dependencies, but third-party code outside of the distros' control too.
7 In reaction to these problems, the distro maintainers replaced
8 ``requests.packages`` with a magical "stub module" that imports the correct
9 modules. The implementations were varying in quality and all had severe
10 problems. For example, a symlink (or hardlink) that links the correct modules
11 into place introduces problems regarding object identity, since you now have
12 two modules in `sys.modules` with the same API, but different identities::
14 requests.packages.urllib3 is not urllib3
16 With version ``2.5.2``, requests started to maintain its own stub, so that
17 distro-specific breakage would be reduced to a minimum, even though the whole
18 issue is not requests' fault in the first place. See
19 https://github.com/kennethreitz/requests/pull/2375 for the corresponding pull
23 from __future__ import absolute_import
30 sys.modules['%s.urllib3' % __name__] = urllib3
36 sys.modules['%s.chardet' % __name__] = chardet