From 27da7b82f8c544826407b7513aaa04fdec3c3138 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 f9981f0ef5f..a17ae601f0b 100644 --- a/python/grass/script/array.py +++ b/python/grass/script/array.py @@ -208,6 +208,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: @@ -313,6 +316,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: