`hermes clean` command fails
hermes clean command on the develop and main branch fails to run.
Behavior:
Run subcommand clean Removing HERMES caches... An error occurred during execution of clean (Find details in './hermes.log')
hermes.log:
1741025466.680383: hermes.cli: ERROR | An error occurred during execution of clean (Find details in './hermes.log')
1741025466.680383: hermes.cli: DEBUG | Original exception was: [WinError 32] The process cannot access the file because it is being used by another process: '.hermes\audit.log'
- No projects containing this file are open and all audit.log files are cleaned up.
- The command functions correctly up until commit 398fc8f29b6d5ca29f72a75f240d10531a7676da on cli.py.
- This issue occurs when installing dependencies via
venvand running the clean command inside a virtual environment. - However, it works correctly when cloning hermes and using
Poetryfor dependency management.
I haven't looked into it too much but it feels like a similar situation to https://github.com/softwarepub/hermes/issues/225. For me it works. Maybe someone on Windows can check, too.
The error is: The process cannot access the file because it is being used by another process: '.hermes\\audit.log'. This happened because the log file was still open when trying to delete the .hermes folder using shutil.rmtree().
I used logging.shutdown() in the hermes\commands\clean\base.py before the deletion, and the clean command works.