From a9256bfa707f5f0816ff554dcc44f1808b707d22 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 6 Apr 2017 09:41:49 +0900 Subject: [PATCH 1/5] Remove Sphinx.egg-info on `make clean` --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 101cfca2c..6df3ef0ad 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,7 @@ clean-backupfiles: clean-generated: find . -name '.DS_Store' -exec rm -f {} + + rm -rf Sphinx.egg-info/ rm -rf doc/_build/ rm -f sphinx/pycode/*.pickle rm -f utils/*3.py* From b6e4cceb8f34483d46a6cbf4410cad91f50531bf Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 8 Apr 2017 13:41:06 +0900 Subject: [PATCH 2/5] Fix #3614: Sphinx crashes with requests-2.5.0 --- CHANGES | 2 ++ sphinx/util/requests.py | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 6ef2c3b2b..e192bf5b7 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,8 @@ Features added Bugs fixed ---------- +* #3614: Sphinx crashes with requests-2.5.0 + Testing -------- diff --git a/sphinx/util/requests.py b/sphinx/util/requests.py index 48d9ae93a..9fe4cfdcd 100644 --- a/sphinx/util/requests.py +++ b/sphinx/util/requests.py @@ -36,6 +36,16 @@ except ImportError: # for requests < 2.4.0 InsecureRequestWarning = None +try: + from requests.packages.urllib3.exceptions import InsecurePlatformWarning +except ImportError: + try: + # for Debian-jessie + from urllib3.exceptions import InsecurePlatformWarning + except ImportError: + # for requests < 2.4.0 + InsecurePlatformWarning = None + # try to load requests[security] (but only if SSL is available) try: import ssl @@ -48,8 +58,8 @@ else: pkg_resources.VersionConflict): if not getattr(ssl, 'HAS_SNI', False): # don't complain on each url processed about the SSL issue - requests.packages.urllib3.disable_warnings( - requests.packages.urllib3.exceptions.InsecurePlatformWarning) + if InsecurePlatformWarning: + requests.packages.urllib3.disable_warnings(InsecurePlatformWarning) warnings.warn( 'Some links may return broken results due to being unable to ' 'check the Server Name Indication (SNI) in the returned SSL cert ' From b8fe49b0a43f8415e957a85bc005767c036eedf1 Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Mon, 10 Apr 2017 10:33:53 +0900 Subject: [PATCH 3/5] add appveyor for testing on Windows --- .appveyor.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 000000000..0e40891d7 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,11 @@ +environment: + matrix: + - PYTHON: 36-x64 + +install: + - pip install -U pip setuptools + - pip install -r test-reqs.txt + +test_script: + - tox -e py36 -- -vvv + From 317c86e9b926135f2cc1dfdee56a57ce06850d74 Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Mon, 10 Apr 2017 10:34:53 +0900 Subject: [PATCH 4/5] Revert "add appveyor for testing on Windows" This reverts commit b8fe49b0a43f8415e957a85bc005767c036eedf1. --- .appveyor.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 0e40891d7..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,11 +0,0 @@ -environment: - matrix: - - PYTHON: 36-x64 - -install: - - pip install -U pip setuptools - - pip install -r test-reqs.txt - -test_script: - - tox -e py36 -- -vvv - From 7897678777982e942aa6c22b823aced7ffd07095 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Tue, 11 Apr 2017 23:44:17 +0900 Subject: [PATCH 5/5] Fix #3618: autodoc crashes with tupled arguments --- CHANGES | 1 + sphinx/ext/autodoc.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index e192bf5b7..4035a50ce 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ Bugs fixed ---------- * #3614: Sphinx crashes with requests-2.5.0 +* #3618: autodoc crashes with tupled arguments Testing -------- diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 9e513276f..9203e673b 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -380,10 +380,19 @@ def formatargspec(function, args, varargs=None, varkw=None, defaults=None, for i, arg in enumerate(args): arg_fd = StringIO() - arg_fd.write(format_arg_with_annotation(arg)) - if defaults and i >= defaults_start: - arg_fd.write(' = ' if arg in annotations else '=') - arg_fd.write(object_description(defaults[i - defaults_start])) + if isinstance(arg, list): + # support tupled arguments list (only for py2): def foo((x, y)) + arg_fd.write('(') + arg_fd.write(format_arg_with_annotation(arg[0])) + for param in arg[1:]: + arg_fd.write(', ') + arg_fd.write(format_arg_with_annotation(param)) + arg_fd.write(')') + else: + arg_fd.write(format_arg_with_annotation(arg)) + if defaults and i >= defaults_start: + arg_fd.write(' = ' if arg in annotations else '=') + arg_fd.write(object_description(defaults[i - defaults_start])) formatted.append(arg_fd.getvalue()) if varargs: