[GRASS-dev] [GRASS GIS] #2188: GRASS fails to start on Windows since r58807

#2188: GRASS fails to start on Windows since r58807
---------------------------+------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: pygrass, tgis | Platform: Unspecified
      Cpu: Unspecified |
---------------------------+------------------------------------------------
Adding temporal vector algebra (r58807) broke compilation on Windows and
some Ubuntu machines. During start up it fails:

{{{
Cleaning up temporary files...
Starting GRASS GIS...
Traceback (most recent call last):
   File "C:\Program Files (x86)\GRASS GIS
7.0.svn\etc\gui\wxpython\gis_set.py", l
ine 48, in <module>
     from gui_core.dialogs import TextEntryDialog
   File "C:\Program Files (x86)\GRASS GIS
7.0.svn\etc\gui\wxpython\gui_core\dialo
gs.py", line 49, in <module>
     from gui_core.gselect import LocationSelect, MapsetSelect, Select, \
   File "C:\Program Files (x86)\GRASS GIS
7.0.svn\etc\gui\wxpython\gui_core\gsele
ct.py", line 59, in <module>
     import grass.temporal as tgis
   File "C:\Program Files (x86)\GRASS GIS
7.0.svn\etc\python\grass\temporal\__ini
t__.py", line 29, in <module>
     from temporal_vector_algebra import *
   File "C:\Program Files (x86)\GRASS GIS
7.0.svn\etc\python\grass\temporal\tempo
ral_vector_algebra.py", line 436, in <module>
     m_overlay = pygrass.Module('v.overlay', quiet=True, run_=False)
   File "C:\Program Files (x86)\GRASS GIS
7.0.svn\etc\python\grass\pygrass\module
s\interface\module.py", line 247, in __init__
     raise GrassError(str_err % self.name)
grass.pygrass.errors.GrassError: "Module 'v.overlay' not found, please
check tha
t the module exist"
Error in GUI startup. If necessary, please report this error to the GRASS
develo
pers.
}}}

I will move the tgis import to the places where it's actually needed, so
it won't be imported when the gui starts. But still I am not sure about
the other imports in temporal_vector_algebra.py. Can tgis be used without
pygrass? Is pygrass needed for temporal vector algebra only? The imports
should be more careful. Also it would be good to understand what's the
problem with pygrass.Module v.overlay.

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

#2188: GRASS fails to start on Windows since r58807
---------------------------+------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: pygrass, tgis | Platform: Unspecified
      Cpu: Unspecified |
---------------------------+------------------------------------------------

Comment(by annakrat):

Tgis import moved in r58883.

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

#2188: GRASS fails to start on Windows since r58807
---------------------------+------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: pygrass, tgis | Platform: Unspecified
      Cpu: Unspecified |
---------------------------+------------------------------------------------

Comment(by zarch):

Hi Anna,

Replying to [ticket:2188 annakrat]:
> Also it would be good to understand
> what's the problem with pygrass.Module v.overlay.
[[BR]]

The problem is that Module try to run:

{{{
get_cmd_xml = subprocess.Popen([cmd, "--interface-description"],
                                stdout=subprocess.PIPE)
}}}

But an OSError is raised.

I've modified the code to give a clearer message and avoid to mask the
original error, see (r58885).

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

#2188: GRASS fails to start on Windows since r58807
---------------------------+------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: pygrass, tgis | Platform: Unspecified
      Cpu: Unspecified |
---------------------------+------------------------------------------------

Comment(by annakrat):

Replying to [comment:2 zarch]:
> Hi Anna,
>
> Replying to [ticket:2188 annakrat]:
> > Also it would be good to understand
> > what's the problem with pygrass.Module v.overlay.
> [[BR]]
>
>
> The problem is that Module try to run:
>
>
> {{{
> get_cmd_xml = subprocess.Popen([cmd, "--interface-description"],
> stdout=subprocess.PIPE)
> }}}
>
> But an OSError is raised.
>
> I've modified the code to give a clearer message and avoid to mask the
original error, see (r58885).
>

GRASS starts again, however temporal framework is not working because the
original problem is still there. PyGRASS Module class is not working on
Windows (I created ticket #2189). Discussion in #2067 suggests that during
import, no PyGRASS Module should be created which is unfortunately
happening in
[http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/temporal/temporal_vector_algebra.py#L436
temporal_vector_algebra.py].

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

#2188: GRASS fails to start on Windows since r58807
---------------------------+------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Keywords: pygrass, tgis | Platform: Unspecified
      Cpu: Unspecified |
---------------------------+------------------------------------------------

Comment(by huhabla):

I committed a patch that should solve the import problem of the temporal
vector algebra, please try r58915.
I have removed the PyGRASS module creation at import time, which is bad by
design.

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

#2188: GRASS fails to start on Windows since r58807
--------------------------+-------------------------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 7.0.0
Component: wxGUI | Version: svn-trunk
Resolution: fixed | Keywords: pygrass, tgis
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by annakrat):

  * status: new => closed
  * resolution: => fixed

Comment:

Replying to [comment:4 huhabla]:
> I committed a patch that should solve the import problem of the temporal
vector algebra, please try r58915.
> I have removed the PyGRASS module creation at import time, which is bad
by design.

Thanks a lot. We fixed also the #2189 in PyGRASS, so now everything should
be working.

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