From 70cdc7be8fdb4b802d15dc77131c4c7bced2e966 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 7 Jan 2017 14:16:42 +0900 Subject: [PATCH 1/3] Dependency requirement updates: requests 2.4.0 or above (refs: #3268, #3310) --- CHANGES | 5 +++++ setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 3baa9c17c..2ae07a1ab 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ Release 1.5.2 (in development) =============================== +Incompatible changes +-------------------- + +* Dependency requirement updates: requests 2.4.0 or above (refs: #3268, #3310) + Features added -------------- diff --git a/setup.py b/setup.py index 3582124ac..fa0be674f 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', ] extras_require = { # Environment Marker works for wheel 0.24 or later From 62329c82f63661df334728e39d0c96ddcbd49ebd Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 7 Jan 2017 14:29:19 +0900 Subject: [PATCH 2/3] Fix #3268: Sphinx crashes with requests package from Debian jessie --- CHANGES | 1 + sphinx/util/requests.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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: From 5cff4b15c2f9c232b50a0b302cf25a91fb23ac0b Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 7 Jan 2017 15:36:07 +0900 Subject: [PATCH 3/3] Fix tox.ini for pytest --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 09241c1d8..b3f084a4d 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] @@ -48,5 +48,5 @@ deps= [testenv:py35] 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