[GRASS-dev] [GRASS GIS] #2008: grass.script's find_program() can't find modules

GRASS GIS trac at osgeo.org
Thu Jun 20 02:22:53 PDT 2013

#2008: grass.script's find_program() can't find modules
  Reporter:  hamish    |       Owner:  grass-dev@…              
      Type:  defect    |      Status:  reopened                 
  Priority:  critical  |   Milestone:  6.4.4                    
 Component:  Python    |     Version:  svn-releasebranch64      
Resolution:            |    Keywords:  find_program()           
  Platform:  All       |         Cpu:  x86-64                   

Comment(by zarch):

 Replying to [comment:12 glynn]:
 > [snip]
 > That won't work on windows, where PATHEXT also has to be considered.
 > There are probably other cases which it doesn't handle, e.g. the
 > executable exists but cannot be run for whatever reason. The previous
 > implementation (which will be reinstated today unless someone provides
 > a legitimate reason not to) is robust against such issues.

 As I already said we don't have to use my implementation...
 But why not use the one developed by the python developers?

 If the meaning of this function is just a python replacement for the
 equivalent "which" bash command. The implementation using Popen, it does
 not provide any information about where the program is, therefore is
 conceptually different from "which", and personally I find much more clean
 ask only for the program, instead of asking for the program AND one

 Moreover asking only for the program is less prone to errors, that can be
 introduce by change of the command interface, and this is especially true
 if we use this function for library developed by others communities.
 But anyway it is not a strong opinion.

Ticket URL: <https://trac.osgeo.org/grass/ticket/2008#comment:14>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list