This pull request refactors multiple instances of file handling across different files by replacing direct
open()
calls with context managers. The change does not affect the core functionality of the application but improves resource management by ensuring that files are properly closed after use. This results in cleaner code and better resource handling without altering any existing behavior.