#14414: runsnake command broken
-------------------------------------+-------------------------------------
       Reporter:  nbruin             |        Owner:  tbd
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.4
      Component:  performance        |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Frédéric Chapoton  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/ticket/14414                |  f2654aea5ade94a5f43d87dc3b83906c57054545
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 Replying to [comment:25 jdemeyer]:
 > But really, the `try`/`except` style is preferred by Python...
 Yes, I know that as a general rule, pythonistas seem to promote it, but
 one shouldn't apply this blindly. The problem is that checking that it's
 hard to write and "except" class that guarantees it only catches the
 particular OSError resulting from the relevant file not existing.

 A priori, there may be loads of reasons why os.system might return an
 OSError, and I ''only'' want to try something else if `runsnake` is
 ''not'' installed in sage; otherwise I'd prefer to see an error. I
 certainly get that effect by testing the presence of `runsnake`. If
 `$SAGE_LOCAL/bin/runsnake` exists but is not executable, an error is also
 more appropriate than silently trying something else, so not testing
 executability also leads to better error reporting.

 I think it's good to be aware that `try/except` can be quite efficient in
 python and for some operations is less prone to race conditions, but one
 shouldn't apply it blindly. It's simply too hard to get a sufficiently
 fine filtering in the except clause.

--
Ticket URL: <http://trac.sagemath.org/ticket/14414#comment:26>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to