#8303: Sage cannot work with files with spaces in their names
------------------------------+---------------------------------------------
Reporter: ddrake | Owner: ddrake
Type: defect | Status: new
Priority: major | Milestone: sage-4.3.3
Component: user interface | Keywords: spaces filenames
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Changes (by ddrake):
* owner: was => ddrake
Comment:
I have the beginnings of patch, but I already know some of the problems
going on here.
* First, if $1 contains spaces, then whenever you do {{{if [ $1 = "blah"
]}}} the shell expands $1 into multiple words and the test gets confused.
The script {{{sage-sage}}} is riddled with such things, which is the
source of the "too many arguments" business above.
* Second, the sage-sage script, if given non-option arguments (i.e., no
-python, -preparse, etc) punts to the Python script sage-run. Inside sage-
run, we have things like
{{{
os.system('"$SAGE_LOCAL/bin/sage-python" %s.py %s'%(file[:-5], options))
}}}
where "options" contains all the arguments you originally passed to Sage.
Unfortunately, when you do {{{os.system}}}, it seems to split words on all
whitespace, which means at this point, we lose all information about
command-line arguments with spaces in them.
It looks like we should be using subprocess.Popen
(http://docs.python.org/library/subprocess.html#subprocess.Popen), which
accepts a ''list'' of arguments and hence can deal with spaces properly.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8303#comment:1>
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.