#1342: grass.core.find_program() problem with ssh and other
---------------------------------+------------------------------------------
Reporter: lucadelu | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Keywords: python find_program | Platform: Linux
Cpu: Unspecified |
---------------------------------+------------------------------------------
there are some program that print help message to stderr instead stdout
and this return false instead true in grass.core.find_program().[[BR]]
With martin we see:[[BR]]
ssh --help[[BR]]
echo $?[[BR]]
255[[BR]]
#1342: grass.core.find_program() problem with ssh and other
---------------------------------+------------------------------------------
Reporter: lucadelu | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Keywords: python find_program | Platform: Linux
Cpu: Unspecified |
---------------------------------+------------------------------------------
Comment(by glynn):
Replying to [ticket:1342 lucadelu]:
> there are some program that print help message to stderr instead stdout
and this return false instead true in grass.core.find_program().
Whether the program prints anything to either stream is entirely
irrelevant; find_program() simply checks the return code.
In order for find_program() to work, you need to find some invocation
which returns a zero exit status (indicating success). If running the
command with --help is considered an error (non-zero exit status), you'll
need to find some other option. E.g. for ssh, you can use "ssh -V".
#1342: grass.core.find_program() problem with ssh and other
-----------------------+----------------------------------------------------
Reporter: lucadelu | Owner: grass-dev@…
Type: defect | Status: closed
Priority: normal | Milestone: 7.0.0
Component: Python | Version: svn-trunk
Resolution: invalid | Keywords: python find_program
Platform: Linux | Cpu: Unspecified
-----------------------+----------------------------------------------------
Changes (by lucadelu):
* status: new => closed
* resolution: => invalid
Comment:
Replying to [comment:1 glynn]:
> In order for find_program() to work, you need to find some invocation
which returns a zero exit status (indicating success). If running the
command with --help is considered an error (non-zero exit status), you'll
need to find some other option. E.g. for ssh, you can use "ssh -V".