Skip to content

Fix Windows file-locking error#86

Open
DrVinay wants to merge 1 commit into
NVlabs:mainfrom
DrVinay:delete-csv-for-windows
Open

Fix Windows file-locking error#86
DrVinay wants to merge 1 commit into
NVlabs:mainfrom
DrVinay:delete-csv-for-windows

Conversation

@DrVinay

@DrVinay DrVinay commented May 13, 2026

Copy link
Copy Markdown

On Windows, open file handles cannot be deleted, unlike Linux. System opened a temporary CSV log file but had no close() method, causing os.unlink() to fail in tests.

Changes made:
Added System.close() to system.py to release the CSV log handle
Updated test_create_system_registry.py to initialize system = None before try, then call system.close() in finally before unlinking the temp file.

This fixes the cross-platform inconsistency where tests passed in Linux CI but failed locally on Windows.

@jarcherNV

Copy link
Copy Markdown
Collaborator

Sorry we haven't got to reviewing this yet, and thanks for implementing this.

I think this is the right direction. Since System now owns an explicit file handle, can we also call system.close() from SystemManager.close_session() before deleting the session?

Right now this fixes the test cleanup path, but normal controller sessions still keep the CSV log file handle open after close_session(). That seems like the same Windows file-locking issue in the production lifecycle.

Could we add or update a SystemManager lifecycle test so closing a session also closes the underlying System log handle? That would cover the real path, not just the direct create_system() test.

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