Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "sage -c 'attach(...); print 3'" work right #15275

Closed
jhpalmieri opened this issue Oct 13, 2013 · 7 comments
Closed

Make "sage -c 'attach(...); print 3'" work right #15275

jhpalmieri opened this issue Oct 13, 2013 · 7 comments

Comments

@jhpalmieri
Copy link
Member

This was first reported on 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.

Component: scripts

Author: André Apitzsch

Branch/Commit: fdc586f

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/15275

@jhpalmieri jhpalmieri added this to the sage-6.1 milestone Oct 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@a-andre
Copy link

a-andre commented Jan 9, 2015

comment:5

Problem was introduced by #508.
Since I couldn't find an answer why ./sage -c "attach file.sage" was supposed to work, I suggest to revert the changes made in #508.

@jdemeyer
Copy link

comment:6

+1 to undo the "something clever"

@a-andre
Copy link

a-andre commented Jan 11, 2015

Commit: fdc586f

@a-andre
Copy link

a-andre commented Jan 11, 2015

Author: André Apitzsch

@a-andre
Copy link

a-andre commented Jan 11, 2015

Branch: u/aapitzsch/ticket/15275

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@vbraun
Copy link
Member

vbraun commented Jan 24, 2015

Changed branch from u/aapitzsch/ticket/15275 to fdc586f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants