Skip to content

Conversation

@avinxshKD
Copy link

Fixes resource leaks throughout mkconcore.py where file handles weren't properly closed on exception paths.

Changes:

  • Config reads (lines 107-113): wrapped in with blocks
  • GraphML parse (line 182): wrapped in with block
  • 12 template file copies (lines 413-527): moved source reads into with blocks, removed manual .close() calls
  • Dockerfile template copy: consolidated path logic, wrapped in with block
  • 8 script handles (fbuild/frun/etc): added atexit cleanup as safety net for exception paths

All bare open() calls now use context managers. Script handles that span 900+ lines get automatic cleanup via atexit.register() to handle any edge cases where early exit could leave handles open.

Closes #241

@avinxshKD
Copy link
Author

@pradeeban Hey the test failures are unrelated, they're missing dependencies (click module) in the CI environment. This PR only modifies mkconcore.py file handle management with no logic changes.
Pls check, thanks

@pradeeban pradeeban merged commit dda78db into ControlCore-Project:dev Feb 11, 2026
1 of 6 checks passed
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 this pull request may close these issues.

2 participants