From e8a2509c6be8fe80a74e6c44f9e1af00fb9a7bea Mon Sep 17 00:00:00 2001 From: Anna Petrasova Date: Mon, 23 Oct 2023 21:15:50 -0400 Subject: [PATCH] grass.script: ensure memmap content is flushed before writing to a raster (#3206) --- python/grass/script/array.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/grass/script/array.py b/python/grass/script/array.py index da22d876d27..5124f5ddc37 100644 --- a/python/grass/script/array.py +++ b/python/grass/script/array.py @@ -210,6 +210,9 @@ def write(self, mapname, title=None, null=None, overwrite=None, quiet=None): else: raise ValueError(_("Invalid kind <%s>") % kind) + # ensure all array content is written to the file + self.flush() + reg = gcore.region(env=self._env) try: @@ -315,6 +318,9 @@ def write(self, mapname, null=None, overwrite=None, quiet=None): else: raise ValueError(_("Invalid kind <%s>") % kind) + # ensure all array content is written to the file + self.flush() + reg = gcore.region(True, env=self._env) try: