Merge pull request #2882 from tkelman/linkcheck-403

[stable] linkcheck: Fall back to a GET request on 403 status
This commit is contained in:
Takeshi KOMIYA 2016-08-22 21:35:47 +09:00 committed by GitHub
commit 8e777063fd
2 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@ Bugs fixed
* #2870: flatten genindex columns' heights.
* #2856: Search on generated HTML site doesnt find some symbols
* #2882: Fall back to a GET request on 403 status in linkcheck
Release 1.4.6 (released Aug 20, 2016)
=====================================

View File

@ -183,10 +183,10 @@ class CheckExternalLinksBuilder(Builder):
f = opener.open(req, **kwargs)
f.close()
except HTTPError as err:
if err.code != 405:
if err.code not in (403, 405):
raise
# retry with GET if that fails, some servers
# don't like HEAD requests and reply with 405
# don't like HEAD requests and reply with 403 or 405
req = Request(req_url)
f = opener.open(req, **kwargs)
f.close()