Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bobneuman opened this issue Oct 30, 2024 · 1 comment

Comments

@bobneuman
Copy link

bobneuman commented Oct 30, 2024

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:
@timvink timvink closed this as completed in e082846 Nov 4, 2024
@timvink
Copy link
Owner

timvink commented Nov 4, 2024

Thanks for creating the issue!

I just released the fix in a new version on pypi. Details here: https://github.com/timvink/mkdocs-git-authors-plugin/releases/tag/v0.9.2

Let me know if this fixes it

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

No branches or pull requests

2 participants