Opened 14 years ago
Closed 14 years ago
#1342 closed defect (invalid)
grass.core.find_program() problem with ssh and other
Reported by: | lucadelu | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.0.0 |
Component: | Python | Version: | svn-trunk |
Keywords: | python find_program | Cc: | |
CPU: | Unspecified | Platform: | Linux |
Description
there are some program that print help message to stderr instead stdout and this return false instead true in grass.core.find_program().
With martin we see:
ssh --help
echo $?
255
instead
svn --help
echo $?
0
Change History (2)
follow-up: 2 comment:1 by , 14 years ago
comment:2 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Replying to 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".
Ok, thanks it works for me
Note:
See TracTickets
for help on using tickets.
Replying to lucadelu:
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".