Repository navigation
Conversation
Vect_open_sidx() in update mode left the file handle open when the index was loaded into memory. Vect_save_sidx() then replaced the handle, so the file stayed open until the process ended. On Windows this made removing the map fail with 'Unable to delete file .../sidx'. The new test checks that no handle to the sidx file is left after a map opened with pygrass in 'rw' mode is closed. AI assistance was used to diagnose the failure and to write the fix and the test.
The expected path is built with os.path.join(), which uses backslashes on Windows, while get_path() substitutes into a path written with slashes.
Owner
Author
|
Can you verify that the pytest and the doctest actually run on windows, and that it passes? |
Owner
Author
|
Checked in the Windows job log for 27aba9e:
Generated by Claude Code |
2 tasks
Owner
Author
|
Verified on Windows with #750, which has only the new test and no fix. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes the
sidxfile handle thatVect_open_sidx()left open when a map is opened in update mode, and compares normalized paths in theget_pathdoctest.Motivation and context
On Windows
test_pygrass_vector_doctests.pyfailed in two doctests: removing a map after it was opened withrwfailed because thesidxfile was still open (on other platforms this leaked a file descriptor), andget_pathcompared a path with slashes to one built byos.path.join().How has this been tested?
New pytest test that fails without the fix,
test_pygrass_vector_doctests.pywith the CI dataset (99 tests pass), and the pygrass vector pytest tests.Types of changes
Checklist
pre-defined prefixes
of this project.
AI assistance was used to diagnose the failure and to write the fix and the test.
Generated by Claude Code