Skip to content

AttributeError: 'File' object has no attribute 'src_dir' on line 121: if file.src_dir is None:  #99

@bobneuman

Description

@bobneuman

We updated our plugin and received an AttributeError: 'File' object has no attribute 'src_dir'

File: .... /lib/python3.9/site-packages/mkdocs_git_authors_plugin/plugin.py", line 121, in on_files
if file.src_dir is None:
AttributeError: 'File' object has no attribute 'src_dir'

This code was added in the merge on 25 Oct 2024 blame

It needs to check for the attribute before the value in the same way as "hasattr(file, "generated_by")"

 if hasattr(file, 'src_dir') and file.src_dir is None:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions