Skip to content

Ensure linkcheck items are comparable#8579

Merged
tk0miya merged 1 commit intosphinx-doc:3.4.xfrom
francoisfreitag:fix-queue
Dec 23, 2020
Merged

Ensure linkcheck items are comparable#8579
tk0miya merged 1 commit intosphinx-doc:3.4.xfrom
francoisfreitag:fix-queue

Conversation

@francoisfreitag
Copy link
Copy Markdown
Member

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

@francoisfreitag francoisfreitag force-pushed the fix-queue branch 4 times, most recently from 6b80659 to a9a83f0 Compare December 22, 2020 20:18
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 tk0miya added this to the 3.4.1 milestone Dec 23, 2020
@tk0miya tk0miya merged commit 46eaa5d into sphinx-doc:3.4.x Dec 23, 2020
@tk0miya
Copy link
Copy Markdown
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.

2 participants