Skip to content

Debug fill function so it handles cases where no working directory de…#4

Merged
barne856 merged 4 commits into
mainfrom
debug-fill-v1
Jun 17, 2026
Merged

Debug fill function so it handles cases where no working directory de…#4
barne856 merged 4 commits into
mainfrom
debug-fill-v1

Conversation

@qijuechenwsp

Copy link
Copy Markdown
Contributor

…fined. Close files that are opened/edited by gdal.

Hi there, Thomas and I are using overflow in our sinkhole tool and find that when working directory is not defined in fill function, it would report error like "/...system path.../label.tif" is in use. I tested the before and after versions for the edits I made here and believe fill_depressions_tiled.py is the cause and added lines should fix it.

…fined. Close files that are opened/edited by gdal.
@qijuechenwsp
qijuechenwsp requested a review from thwllms June 17, 2026 15:37
@qijuechenwsp
qijuechenwsp requested a review from barne856 as a code owner June 17, 2026 15:37
@barne856

Copy link
Copy Markdown
Member

Hey thanks for contributing, it looks like this has to do with the way Windows operates and so it makes sense why this never surfaced in development as we've only developed and tested in Linux or in containers. Windows does not allow files to be deleted if they are open, so the rmtree here needs to happen after the datasets are closed. We've used = None to close datasets since .Close() was introduced in GDAL >= 3.7. If we use that API we'll need to bump the minimum version from 3.6 to 3.7 in the pyproject.toml which shouldn't be an issue as 3.7 is several years old at this point later versions are available in ArcGIS Pro and many Linux distribution's repositories.

I also noticed a similar issue in the resolve flats process which should also be fixed. I'll push a commit with the changes.

@barne856
barne856 merged commit 6748c53 into main Jun 17, 2026
6 checks passed
@barne856
barne856 deleted the debug-fill-v1 branch June 17, 2026 20:10
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