Handle ConnectionError on HTTP HEAD Requests#9309
Merged
tk0miya merged 17 commits intosphinx-doc:4.xfrom Jun 13, 2021
Merged
Conversation
Member
francoisfreitag
left a comment
There was a problem hiding this comment.
Thanks for the nice report and patch! 👍
I agree Sphinx could be more tolerant here.
Please add a note to the CHANGES.
tests/roots/test-linkcheck-connection-error-on-http-head/index.rst
Outdated
Show resolved
Hide resolved
…ager instead of relying on an external website.
Member
francoisfreitag
left a comment
There was a problem hiding this comment.
Nice! A few minor changes and this should be good to go.
tests/roots/test-linkcheck-connection-error-on-http-head/index.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: François Freitag <mail@franek.fr>
Co-authored-by: François Freitag <mail@franek.fr>
Co-authored-by: François Freitag <mail@franek.fr>
Co-authored-by: François Freitag <mail@franek.fr>
Co-authored-by: François Freitag <mail@franek.fr>
Co-authored-by: François Freitag <mail@franek.fr>
Co-authored-by: François Freitag <mail@franek.fr>
Co-authored-by: François Freitag <mail@franek.fr>
francoisfreitag
approved these changes
Jun 10, 2021
Member
francoisfreitag
left a comment
There was a problem hiding this comment.
Looking good to me, thanks!
Co-authored-by: François Freitag <mail@franek.fr>
Member
|
Thank you for your contribution. +1 for merging this into 4.x branch instead of 4.0.x. Usually, we use 4.0.x branch only for severe or critical bug fixes. So this is better to merge this into 4.x branch. |
tk0miya
approved these changes
Jun 13, 2021
Member
|
Merged. Thank you for your contribution! @francoisfreitag Thank you for reviewing :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Subject: Resolves #9306
Feature or Bugfix
Purpose
make linkcheckto fail on URLs that will open and render properly in a web browser. Prior to this fix, the link checker would incorrectly call these links broken.Detail
HTTP HEADrequests, but will return the requested document forHTTP GETrequests. Thelinkcheck.pycode wasn't catching theConnectionErrorexception, and as a result the code would skip therequests.get()attempt. With this fix, ifrequests.head()raises aConnectionError, it will attempt arequests.get()which, for the UT Patent website, succeeds. If the website truly is rejecting all connections, an exception on therequests.get()call will still send control to theexcept Exception as errblock as before.Relates