Skip to content

Report a directory missing in the reference, instead of a traceback - #20

Merged
andiwand merged 1 commit into
mainfrom
fix/missing-in-reference-traceback
Oct 27, 2026
Merged

andiwand merged 1 commit into
mainfrom
fix/missing-in-reference-traceback

Conversation

@andiwand

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

What changes

collect_tasks made each path relative to the root of tree A. A directory that only tree B has is not below that root. So relative_to raised a ValueError, and compare-html stopped with a traceback instead of the report "missing in reference (A)".

The walk now carries the relative path itself (rel), which is the same for both trees. The root parameter is gone; only the recursion used it.

OpenDocument.core hits this when a PR adds new test fixtures, for example opendocument-app/OpenDocument.core#1293:

ValueError: 'build/test/output/odr-public/output/docx/encrypted-agile.docx' is not in the subpath of 'test/data/reference-output/odr-public/output'

Checks

  • The new tests/test_collect_tasks.py has a file and a directory on each side only, and a pair in a shared directory. It fails with the ValueError above on main and passes with this change.
  • All 9 tests pass, and black src tests changes nothing.

https://claude.ai/code/session_01FW6WZZjzbcNvNppdDrFxKB

collect_tasks made each path relative to the root of tree A. A directory
that only tree B has is not below that root, so relative_to raised a
ValueError, and the comparison stopped with a traceback. The walk now
carries the relative path itself, which is the same for both trees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FW6WZZjzbcNvNppdDrFxKB
@andiwand
andiwand merged commit 4281609 into main Oct 27, 2026
6 checks passed
@andiwand
andiwand deleted the fix/missing-in-reference-traceback branch October 27, 2026 21:06
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.

1 participant