Skip to content

use context managers for file I/O#301

Merged
pradeeban merged 2 commits intoControlCore-Project:devfrom
avinxshKD:refactor-file-io-v2
Feb 14, 2026
Merged

use context managers for file I/O#301
pradeeban merged 2 commits intoControlCore-Project:devfrom
avinxshKD:refactor-file-io-v2

Conversation

@avinxshKD
Copy link

Fixes #298

Wrapped all open() calls with context managers in cwrap.py, testsou/concore.py, and testsou/ccpymat.dir/concore.py. This ensures files are properly closed even if an exception occurs, preventing descriptor leaks especially in loops where files are opened repeatedly.

This was referenced Feb 13, 2026
@pradeeban
Copy link
Member

@avinxshKD can you pls resolve the conflicts.

@avinxshKD
Copy link
Author

@avinxshKD can you pls resolve the conflicts.

yes, on it

@avinxshKD avinxshKD force-pushed the refactor-file-io-v2 branch 2 times, most recently from c539ee4 to e653cd8 Compare February 14, 2026 06:52
@avinxshKD
Copy link
Author

@pradeeban hey hve rebased on upstream/dev. Dropped the testsou files since they were deleted upstream. For
cwrap.py, I kept the new exception handling (OSError, IOError) while applying the context managers

@pradeeban pradeeban merged commit c454795 into ControlCore-Project:dev Feb 14, 2026
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