Skip to content

RuntimeError: absolute path '.../dataclasses.py' is not a descendant of the current working directory or of the system's python libraryΒ #456

@Lucas-C

Description

@Lucas-C

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions