Repository navigation
Conversation
…y file Six save/load cases held a `NamedTemporaryFile` open and then asked `compiled_predictor.save()` to write that same path. POSIX allows it; Windows refuses the second handle with `PermissionError: [Errno 13]`, which is why the file and image adapter suites were red there and green on CI. `TemporaryDirectory` gives a path with no handle attached, so the cases exercise the save/load code instead of the platform's file locking.
Contributor
[Low impact] The PR appears safe to merge; the test changes preserve the existing save/load checks. SummaryUpdates six save/load test cases to avoid writing over an open temporary file on Windows.
No actionable issues found. Tests were not run during this review. Reviews (2) · Last reviewed commit: "test(signatures): save through a temp di..." · Reviewed by Greptile |
This branch has not been deployed
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.
Six save/load cases in the signature adapter suites hold a temporary file open and then ask DSPy to write that same path:
POSIX lets a second handle write over a file that is already open; Windows refuses it with
PermissionError: [Errno 13] Permission denied: 'C:\...\tmp_zpw3l9u.json'. So the suites are green on CI and red for anyone on Windows, for a reason that has nothing to do with saving:Change
Use
TemporaryDirectoryand save to a path inside it. Nothing else moves: the same signature, the samesave()/load()calls, the same assertions after the block.Verification
pytest tests/signatures/test_adapter_file.py tests/signatures/test_adapter_image.py-> 72 passed, 2 xfailed; onmainthe same two files are 66 passed, 6 failed, the six listed above.pytest tests/signatures-> 127 passed, 2 xfailed.ruff checkandruff formatclean on both files (ruff check tests/signatures/still reports the 11 pre-existing findings intest_custom_types.py, which this does not touch).Found while looking at save/load round trips; test-side only, no behaviour change.