#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 was):

 Replying to [comment:8 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.

 Your confused about what's going on.  If you put
 {{{
     print "filename = '%s'"%filename
 }}}
 at the top of the load function, then do {{{sage -br}}} and type
 {{{
 sage: load "f" + "oo.py"
 }}}
 you'll see
 {{{
 filename = '"f" + "oo.py"'
 }}}
 which illustrates that the input is not eval'd.  That's why the docstring
 starts with
 {{{
     Executes a file in the scope given by ``globals``.  The
     ``filename`` itself is also evaluated in the scope.
 }}}
 This is documented behavior.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12671#comment:9>
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.

Reply via email to