[GRASS-dev] [GRASS GIS] #2791: GridModule error and modified SEARCH PATH

#2791: GridModule error and modified SEARCH PATH
------------------------+-------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: PyGRASS | Version: svn-trunk
Keywords: GridModule | CPU: All
Platform: Linux |
------------------------+-------------------------
When using GridModule, I am getting error:

{{{
----> 1 grd.run()

/usr/lib/grass70/etc/python/grass/pygrass/modules/grid/grid.py in
run(self, patch, clean)
     530 if self.debug:
     531 for wrk in self.get_works():
--> 532 cmd_exe(wrk)
     533 else:
     534 pool = mltp.Pool(processes=self.processes)

/usr/lib/grass70/etc/python/grass/pygrass/modules/grid/grid.py in
cmd_exe(args)
     344 """
     345 bbox, mapnames, gisrc_src, gisrc_dst, cmd, groups = args
--> 346 src, dst = get_mapset(gisrc_src, gisrc_dst)
     347 env = os.environ.copy()
     348 env['GISRC'] = gisrc_dst

/usr/lib/grass70/etc/python/grass/pygrass/modules/grid/grid.py in
get_mapset(gisrc_src, gisrc_dst)
     139 src = Mapset(msrc, lsrc, gsrc)
     140 dst = Mapset(mdst, ldst, gdst)
--> 141 visible = [m for m in src.visible]
     142 visible.append(src.name)
     143 dst.visible.extend(visible)

/usr/lib/grass70/etc/python/grass/pygrass/gis/__init__.py in
__iter__(self)
     383
     384 def __iter__(self):
--> 385 for mapset in self.read():
     386 yield mapset
     387

/usr/lib/grass70/etc/python/grass/pygrass/gis/__init__.py in read(self)
     393 return [l.strip() for l in lines]
     394 lns = ['PERMANENT', ]
--> 395 self.write(lns)
     396 return lns
     397

AttributeError: 'VisibleMapset' object has no attribute 'write'

}}}

This happens probably when the SEARCH_PATH is not defined in the mapset.

Also, If I then set it and run successfully the process in parallel, the
search path is changed, it includes all the mapsets in that location,
which shouldn't happen.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2791&gt;
GRASS GIS <https://grass.osgeo.org>

#2791: GridModule error and modified SEARCH PATH
-----------------------+-------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.1.0
Component: PyGRASS | Version: svn-trunk
Resolution: | Keywords: GridModule
       CPU: All | Platform: Linux
-----------------------+-------------------------

Comment (by annakrat):

I hopefully fixed the error in r66746 and backported in r66747. The
modified SEARCH_PATH is still problem.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2791#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>