Skip to content

Conversation

@Abhi-d-gr8
Copy link

This PR fixes a locale-dependent bug in r.fillnulls when using bilinear/bicubic interpolation.

Instead of parsing English error messages from r.resamp.bspline stderr, the script now checks for NULL cells using r.univar -g and exits early when none are present.

This avoids failures in non-English locales and simplifies the control flow.

Fixes #1495.

@github-actions github-actions bot added raster Related to raster data processing Python Related code is in Python module labels Jan 22, 2026
@Abhi-d-gr8 Abhi-d-gr8 force-pushed the fix-1495-r-fillnulls-locale branch from bfd66bd to 0881726 Compare January 22, 2026 22:46
@marisn
Copy link
Contributor

marisn commented Jan 23, 2026

Please add a test for it.
IIRC the reason of checking of stderr contents was that r.surf.bspline reported a non 0 exit status if no NULL cells were found. But non-0 exit status is considered to indicate a failure by code executing the command. Thus tests are needed to be sure that the code doesn't fail with a bizarre error when there is no error.

@Abhi-d-gr8
Copy link
Author

Thanks for the clarification @marisn , and apologies for missing the test initially
I’m still new to contributing here.
I’ll add a regression test for the no-NULL case as suggested.

@Abhi-d-gr8
Copy link
Author

Added a regression test (test_no_nulls) covering the no-NULL input case to ensure r.fillnulls exits successfully without relying on stderr parsing. CI is running.

@github-actions github-actions bot added the tests Related to Test Suite label Jan 23, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
},
precision=1e-6,
)
def test_no_nulls(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff] reported by reviewdog 🐶

Suggested change
def test_no_nulls(self):
def test_no_nulls(self):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module Python Related code is in Python raster Related to raster data processing tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] r.fillnulls tests no nulls case by using error message text

2 participants