fix: handle TypeError when source is None in Sphinx 8.2#240
Merged
dhellmann merged 2 commits intosphinx-contrib:mainfrom Nov 28, 2025
Merged
fix: handle TypeError when source is None in Sphinx 8.2#240dhellmann merged 2 commits intosphinx-contrib:mainfrom
dhellmann merged 2 commits intosphinx-contrib:mainfrom
Conversation
e19f9f7 to
e2b101b
Compare
Fixes sphinx-contrib#234 When docutils.utils.get_source_line() returns None for the source parameter, the code was attempting to call osutil.relpath(None), which caused a TypeError in Sphinx 8.2.3. This can occur with programmatically generated nodes or certain document structures that don't have proper source attribution. Changes: - Added null check before calling osutil.relpath() in builder.py - Use '<unknown>' placeholder when source is None - Added test case that reproduces the issue and verifies the fix Chat log: https://gist.github.com/dhellmann/27d64eb733af50a2c1e460cc40164a11 Co-authored-by: Claude Sonnet 4.5 <ai-assistant@anthropic.com> Signed-off-by: Doug Hellmann <doug@doughellmann.com>
e2b101b to
fe50721
Compare
Something changed in the way hatch is working that makes it not possible to run 'hatch build' inside of a test env. Disable the job while debugging that problem.
This was referenced Jan 2, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #234
When docutils.utils.get_source_line() returns None for the source parameter, the code was attempting to call osutil.relpath(None), which caused a TypeError in Sphinx 8.2.3.
This can occur with programmatically generated nodes or certain document structures that don't have proper source attribution.
Changes:
Chat log: https://gist.github.com/dhellmann/27d64eb733af50a2c1e460cc40164a11