[GRASS-dev] Re: [GRASS GIS] #841: python script modules should use pythonw on OSX; they also ignore GRASS_PYTHON

GRASS GIS trac at osgeo.org
Mon Dec 21 00:05:57 EST 2009


#841: python script modules should use pythonw on OSX; they also ignore
GRASS_PYTHON
--------------------------+-------------------------------------------------
  Reporter:  kyngchaos    |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect       |      Status:  new                      
  Priority:  normal       |   Milestone:  6.5.0                    
 Component:  default      |     Version:  unspecified              
Resolution:               |    Keywords:                           
  Platform:  Unspecified  |         Cpu:  Unspecified              
--------------------------+-------------------------------------------------
Comment (by glynn):

 Replying to [ticket:841 kyngchaos]:

 > wxpython-based python scripts on OSX should be run with pythonw.
 Problem in 6.5 in the new v.krige, and of course in all 7.x scripts.

 Most 7.x scripts don't use wxPython directly. They might use it indirectly
 via g.parser, but that should be dealt with by $GRASS_PYTHON.

 > This is fine for the GUI itself, since the gui script is executed from
 Python (GRASS_PYTHON).  But modules are executed directly, using the
 >
 {{{
 #!/usr/bin/env/python
 }}}
 >
 > method.

 That should be:

 {{{
 #!/usr/bin/env python
 }}}

 No slash between "env" and "python".

 > For OSX, this should be
 >
 {{{
 #!/usr/bin/env/pythonw
 }}}
 >
 > This will probably need to use some kind of .in file for all script
 modules that gets processed during make :(

 AFAICT, most scripts should be using "python", not "pythonw"

 > Though, I see another potential problem with the #! -- it completely
 ignores GRASS_PYTHON,

 That shouldn't be a problem.

 > which could cause trouble if the user or packager wants to override the
 default python in the PATH.  I don't know if it's possible to make the #!
 more dynamic.

 It isn't. The kernel doesn't understand environment variables.

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


More information about the grass-dev mailing list