diff --git a/CHANGES b/CHANGES index 2ae07a1ab..3d2bc693e 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,7 @@ Bugs fixed * The warning type ``misc.highlighting_failure`` does not work * #3294: ``add_latex_package()`` make crashes non-LaTeX builders * The caption of table are rendered as invalid HTML (refs: #3287) +* #3268: Sphinx crashes with requests package from Debian jessie Release 1.5.1 (released Dec 13, 2016) diff --git a/sphinx/util/requests.py b/sphinx/util/requests.py index 697e29087..8b7204c2f 100644 --- a/sphinx/util/requests.py +++ b/sphinx/util/requests.py @@ -17,7 +17,12 @@ import pkg_resources from six import string_types from six.moves.urllib.parse import urlsplit -from requests.packages.urllib3.exceptions import SSLError, InsecureRequestWarning +try: + from requests.packages.urllib3.exceptions import SSLError, InsecureRequestWarning +except ImportError: + # python-requests package in Debian jessie does not provide ``requests.packages.urllib3``. + # So try to import the exceptions from urllib3 package. + from urllib3.exceptions import SSLError, InsecureRequestWarning # try to load requests[security] try: