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: