RuntimeError: absolute path '.../dataclasses.py' is not a descendant of the current working directory or of the system's python library
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
Hi.
In fpdf2 we have been using pdoc3 for several years:
thank you for maintaining this great tool!
I noticed a warning in our execution log:
https://github.com/py-pdf/fpdf2/actions/runs/13482969652/job/37670544099?pr=1374
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/pdoc/html_helpers.py", line 569, in format_git_link
path = _project_relative_path(abs_path)
File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/pdoc/html_helpers.py", line 635, in _project_relative_path
raise RuntimeError(
...<2 lines>...
)
RuntimeError: absolute path '/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/dataclasses.py' is not a descendant of the current working directory or of the system's python library.
I do not quite understand the origin of this stacktrace,
but I suspect that's maybe due to this usage of dataclasses.replace as a method:
https://github.com/py-pdf/fpdf2/blob/2.8.2/fpdf/fonts.py#L75
Do you know how we could prevent this error to be raised?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pdoc/html_helpers.py at format_git_link and _project_relative_path, around lines 569 and 635, then reproduce the report using the linked fpdf2 dataclasses.replace usage. Trace why dataclasses.py is resolved outside the project and verify that documenting fpdf2 no longer raises this RuntimeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100