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

linter: ERROR:capa:[Errno 2] No such file or directory: 'capa/rules/__init__.py' #2350

Closed
mr-tz opened this issue Sep 9, 2024 · 3 comments · Fixed by #2356
Closed

linter: ERROR:capa:[Errno 2] No such file or directory: 'capa/rules/__init__.py' #2350

mr-tz opened this issue Sep 9, 2024 · 3 comments · Fixed by #2356

Comments

@mr-tz
Copy link
Collaborator

mr-tz commented Sep 9, 2024

ERROR:capa:[Errno 2] No such file or directory: 'capa/rules/__init__.py'

see e.g. https://github.com/mandiant/capa-rules/actions/runs/10724056570/job/29870040135

@mr-tz
Copy link
Collaborator Author

mr-tz commented Sep 11, 2024

@williballenthin, do you have an idea what changed resulting in these errors?

@williballenthin
Copy link
Collaborator

I'll take a look in a few minutes

@williballenthin
Copy link
Collaborator

latest_rule_code_file = max([Path("capa/rules/__init__.py"), Path("capa/rules/cache.py")], key=os.path.getmtime)

this line hardcodes the relative location of some source files, and the linter is run from ./rules/ so the source files don't exist. the fix is to use the actual source file path. i'll open a PR.

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

Successfully merging a pull request may close this issue.

2 participants