#15275: Make "sage -c 'attach(...); print 3'" work right
--------------------------+-----------------------------
   Reporter:  jhpalmieri  |            Owner:
       Type:  defect      |           Status:  new
   Priority:  major       |        Milestone:  sage-5.13
  Component:  scripts     |         Keywords:
  Merged in:              |          Authors:
  Reviewers:              |  Report Upstream:  N/A
Work issues:              |           Branch:
     Commit:              |     Dependencies:
   Stopgaps:              |
--------------------------+-----------------------------
 This was first reported on [http://stackoverflow.com/questions/19344741
 /python-sage-attach-from-command-line-and-run-another-command
 stackoverflow].

 While running Sage:
 {{{
 sage: attach("file.sage"); print 3
 }}}
 works, but from the shell:
 {{{
 $ sage -c "attach('file.sage'); print 3"
 }}}
 fails. It actually tries to execute the command
 {{{
 sage "/path/to/'file.sage'; print Integer(2)"
 }}}
 and so it tries to read everything between the first and last quotes as
 the file name, thus producing the error
 {{{
 python: can't open file '/path/to/'file.sage'; print Integer(2)': [Errno
 2] No such file or directory
 }}}
 This is because the script `sage-eval` tries to do something clever when
 the command to be executed starts with `attach` or `load`, but it is
 assuming that the rest of the command consists entirely of the file name.

--
Ticket URL: <http://trac.sagemath.org/ticket/15275>
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/groups/opt_out.

Reply via email to