Skip to content
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

Ensure linkcheck items are comparable #8579

Merged
merged 1 commit into from Dec 23, 2020

Conversation

francoisfreitag
Copy link
Contributor

Feature or Bugfix

  • Bugfix

Purpose

Fixes an issue when a document contains two links to the same URL, one with
an int line number and the other without line number metadata (such as an
image :target: attribute).

Details

Linkcheck organizes the URLs to checks in a PriorityQueue. The items are
tuples (priority, url, docname, lineno).

Tuples where the lineno is None are not comparable with tuples that have
an integer lineno, and PriorityQueue items must be comparable (see
https://bugs.python.org/issue31145).

Using 0 instead of None to represent no line number should not lead to
observable changes, the result logger only logs the line number when it is
truthy.

Relates

Close #8565

Linkcheck organizes the URLs to checks in a PriorityQueue. The items are
tuples (priority, url, docname, lineno).

Tuples where the lineno is `None` are not comparable with tuples that
have an integer lineno, and PriorityQueue items must be comparable (see
https://bugs.python.org/issue31145).

Fixes an issue when a document contains two links to the same URL, one
with an int line number and the other without line number metadata (such
as an image :target: attribute).

Using 0 instead of None to represent no line number should not lead to
observable changes, the result logger only logs the line number when it
is truthy.

Close sphinx-doc#8565
@tk0miya
Copy link
Member

tk0miya commented Dec 23, 2020

Thank you for your quick work!

@francoisfreitag francoisfreitag deleted the fix-queue branch December 25, 2020 11:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants