Opened 5 years ago

Last modified 3 years ago

#2791 new defect

GridModule error and modified SEARCH PATH

Reported by: annakrat Owned by: grass-dev@…
Priority: normal Milestone: 7.2.4
Component: PyGRASS Version: svn-trunk
Keywords: GridModule Cc:
CPU: All Platform: Linux

Description

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.

Change History (7)

comment:1 Changed 5 years ago by annakrat

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

comment:2 Changed 4 years ago by neteler

Milestone: 7.1.07.2.0

Milestone renamed

comment:3 Changed 4 years ago by neteler

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:4 Changed 3 years ago by martinl

Milestone: 7.2.17.2.2

comment:5 Changed 3 years ago by neteler

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:6 Changed 3 years ago by martinl

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:7 Changed 3 years ago by martinl

Milestone: 7.2.4
Note: See TracTickets for help on using tickets.