#8474: Detect whether a program is in the path
-----------------------------+----------------------------------------------
   Reporter:  jhpalmieri     |       Owner:  drkirkby    
       Type:  defect         |      Status:  needs_review
   Priority:  blocker        |   Milestone:  sage-4.3.4  
  Component:  porting        |    Keywords:              
     Author:  John Palmieri  |    Upstream:  N/A         
   Reviewer:                 |      Merged:              
Work_issues:                 |  
-----------------------------+----------------------------------------------

Comment(by jhpalmieri):

 Just to emphasize: on t2.math, I get this behavior (in contrast to using
 "command -v" or "type"):
 {{{
 sage: from subprocess import call, PIPE
 sage: call('which ' + 'ls', shell=True, stdout=PIPE, stderr=PIPE)
 0
 sage: call('which ' + 'lljsdfs', shell=True, stdout=PIPE, stderr=PIPE)
 0
 }}}
 I don't know why.  The same happens with {{{os.system('which lljsdfs')}}},
 and this is what is used in the Sage library.  ("call" is similar in
 behavior to "os.system", but I think "call" is slightly preferred.  It
 also gives better control of stdin, stdout, and stderr.)  So I do think
 this is what's wrong with #8463.  As I said in the description of this
 ticket, the function "have_latex" returns True on t2.math, and I would
 guess that if I could install Sage 4.3.4.alpha0 on t2.math, then the
 comparable "have_chomp" functions would return True as well.  Therefore
 Sage would try to call chomp when doing homology calculations, and since
 the program isn't there, it would crash.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8474#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to