diff --git a/CHANGES b/CHANGES index d27d45d88..21175489b 100644 --- a/CHANGES +++ b/CHANGES @@ -53,6 +53,11 @@ Deprecated Release 1.5.2 (in development) =============================== +Incompatible changes +-------------------- + +* Dependency requirement updates: requests 2.4.0 or above (refs: #3268, #3310) + Features added -------------- @@ -73,6 +78,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/setup.py b/setup.py index 051581cc4..ebf810bf8 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ requires = [ 'babel>=1.3,!=2.0', 'alabaster>=0.7,<0.8', 'imagesize', - 'requests', + 'requests>=2.4.0', 'typing', ] extras_require = { diff --git a/sphinx/util/requests.py b/sphinx/util/requests.py index d358d8435..3f6ff3879 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: diff --git a/tox.ini b/tox.ini index 6bcfc42eb..ae802644b 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist=flake8,py27,py34,py35,py36,pypy,du13,du12,du11 [testenv] deps= six - nose + pytest sqlalchemy whoosh html5lib @@ -15,7 +15,7 @@ setenv = SPHINX_TEST_TEMPDIR = {envdir}/testbuild PYTHONDONTWRITEBYTECODE = true commands= - {envpython} -Wall tests/run.py --ignore-files=test_autodoc_py35 -m '^[tT]est' {posargs} + {envpython} -Wall tests/run.py --ignore tests/py35 {posargs} sphinx-build -q -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html [testenv:pypy] @@ -52,5 +52,5 @@ deps= typed_ast {[testenv]deps} commands= - {envpython} -Wall tests/run.py -m '^[tT]est' {posargs} + {envpython} -Wall tests/run.py {posargs} sphinx-build -q -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html