#12671: attaching files which have spaces in absolute path name fails on second
run
------------------------------------------------+---------------------------
Reporter: ppurka | Owner: jason
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.1
Component: misc | Resolution:
Keywords: attach load preparser sd40.5 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Punarbasu Purkayastha | Merged in:
Dependencies: | Stopgaps:
------------------------------------------------+---------------------------
Comment (by ddrake):
Replying to [comment:7 was]:
> I think you are mischaracterizing what the code does. The point of the
eval is not to "distinguish between strings with and without spaces". The
eval allows for the filename to be determined by valid Python expressions,
the motivating case being
> {{{
> load DATA+"file.sage"
> }}}
It's possible I'm mischaracterizing...but my understanding of Python
function call semantics is that by the time you enter this function,
"`filename`" has already been evaluated. Otherwise, I'm not sure how this
could work in the interpreter:
{{{
sage: def f(s):
....: print 'the last character is {0}'.format(s[-1])
....:
sage: s = 'def'
sage: f('abc' + s)
the last character is f
}}}
The function `f` does not see "`'abc' + s`"; it sees the result of
evaluating `'abc' + s`. The function doesn't need `eval()`, and so I
didn't think that `load` or `attach` would either.
Would you prefer that we restore the positive review here and merge this,
then, after #12719 is merged, deprecate the keyword versions of `load` and
`attach` and make them functions that accept either: (1) a string, which
must be the name of one file, or (2) a list/tuple/etc of strings?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12671#comment:8>
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.