Repository navigation
r.kappa: Avoid reopening NamedTemporaryFile on Windows in testsuite - #7907
Merged
Merged
Conversation
test_file kept a NamedTemporaryFile handle open while passing its path to r.kappa as the output file. Windows rejects a second process opening a file while the creating process still holds the handle; POSIX allows it. Use grass.script.core.tempfile() to get an unopened path instead, the same fix already applied to r.mfilter's testsuite in OSGeo#7878, and drop the now-unneeded @xfail_windows marker. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ninsbl
approved these changes
Sep 6, 2026
echoix
enabled auto-merge (squash)
September 6, 2026 15:59
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
test_fileinraster/r.kappa/testsuite/test_r_kappa.pykept aNamedTemporaryFilehandle open while passing its path tor.kappaas theoutput file. Windows rejects a second process opening a file while the
creating process still holds the handle open; POSIX allows it. Use
grass.script.core.tempfile()to get an unopened path instead, the same fixalready applied to
r.mfilter's testsuite in #7878, and drop thenow-unneeded
@xfail_windowsmarker.Motivation and context
Split out of a PR, which bundled this fix together with unrelated Windows CI
changes (randomized test order infrastructure) (which is now filed as #7906).
This is a standalone, independently mergeable fix.
How has this been tested?
Mirrors the already-merged, already-verified fix for the identical
anti-pattern in
r.mfilter(#7878).Types of changes
Checklist
pre-defined prefixes
of this project.
Generated with Claude Code, from my instructions. (I still reworded the PR body)