Skip to content

linkcheck: retain default do-not-follow for redirects #13467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jayaddison
Copy link
Contributor

Purpose

From some recent notes I've made about this draft, the behaviour is:

  • linkcheck_allowed_redirects:{}: default warn and log redirects without following them
  • linkcheck_allowed_redirects:None: follow all redirects, do not warn about them
  • linkcheck_allowed_redirects:{...}: unmodified

References

@jayaddison jayaddison force-pushed the issue-13462/linkcheck-allowed-redirects-default-none branch from 5681792 to d16e135 Compare April 4, 2025 18:37
@@ -3655,6 +3656,10 @@ and which failures and redirects it ignores.
It can be useful to detect unexpected redirects when using
:option:`the fail-on-warnings mode <sphinx-build --fail-on-warning>`.

To deny all redirects, configure an empty dictionary (the default).

To follow all redirections, configure a value of :code-py:`None`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given recent bugreport #13462 about unconfigured linkcheck_allow_redirects reported as unexpectedly None during sphinx-build -b html ... builds: we should check that running sphinx-build -b linkcheck ... for an affected project yields the expected {} default.

@jayaddison jayaddison marked this pull request as ready for review April 5, 2025 13:00
@jayaddison
Copy link
Contributor Author

linkcheck_allowed_redirects:None: follow all redirects, do not warn about them

Note: using a value of None for linkcheck_allowed_redirects turns out to be undesirable, so I'll close this attempted fix.

Ref: #13462 (comment)

@jayaddison jayaddison closed this Apr 7, 2025
@jayaddison jayaddison deleted the issue-13462/linkcheck-allowed-redirects-default-none branch April 7, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible regression in linkcheck_allowed_redirects default following PR 13452
1 participant