Skip to content

Commit

Permalink
Revert "linkcheck builder: experiment: ensure that any error exceptio…
Browse files Browse the repository at this point in the history
…n from an initial HTTP HEAD request is out-of-scope before performing a fallback HTTP GET request (ensuring that the associated 'response' object's resources can be collected)"

This reverts commit 3682b23.
  • Loading branch information
jayaddison committed Apr 27, 2023
1 parent 10fa3b5 commit 8fee994
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions sphinx/builders/linkcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ def check_uri() -> tuple[str, str, int]:
if not found:
raise Exception(__("Anchor '%s' not found") % anchor)
else:
fallback = False
try:
# try a HEAD request first, which should be easier on
# the server and the network
Expand All @@ -338,11 +337,6 @@ def check_uri() -> tuple[str, str, int]:
except (ConnectionError, HTTPError, TooManyRedirects) as err:
if isinstance(err, HTTPError) and err.response.status_code == 429:
raise
fallback = True
del err

# any err.response from the initial request is now out-of-scope
if fallback:
# retry with GET request if that fails, some servers
# don't like HEAD requests.
with self._session.get(req_url, stream=True,
Expand Down

0 comments on commit 8fee994

Please sign in to comment.