Skip to content

Commit

Permalink
grass.script: ensure memmap content is flushed before writing to a ra…
Browse files Browse the repository at this point in the history
…ster (OSGeo#3206)
  • Loading branch information
petrasovaa committed Oct 24, 2023
1 parent 7bebc6a commit e8a2509
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/grass/script/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e8a2509

Please sign in to comment.