#12671: attaching files which have spaces in absolute path name fails on second 
run
----------------------+-----------------------------------------------------
   Reporter:  ppurka  |          Owner:  jason                
       Type:  defect  |         Status:  needs_review         
   Priority:  major   |      Milestone:  sage-5.0             
  Component:  misc    |       Keywords:  attach load preparser
Work_issues:          |       Upstream:  N/A                  
   Reviewer:          |         Author:  Punarbasu Purkayastha
     Merged:          |   Dependencies:                       
----------------------+-----------------------------------------------------
Changes (by newvalueoldvalue):

  * status:  new => needs_review
  * author:  => Punarbasu Purkayastha


Old description:

> It is not possible to ''watch'' a file which has spaces in its absolute
> path. This is an example:
> {{{
> sage: f1 = 'a.sage'; open(f1,'w').write("print 'h'")
> sage: attach a.sage
> h
> sage: attach
> attach          attached_files
> sage: attached_files()
> ['/tmp/a b/a.sage']
> sage: open(f1,'w').write("print 'p'")
> sage:
> ---------------------------------------------------------------------------
> ValueError                                Traceback (most recent call
> last)
>
> /tmp/a b/<ipython console> in <module>()
>
> /home/punarbasu/Installations/sage-5.0.beta2/local/lib/python2.7/site-
> packages/sage/misc/preparser.pyc in load(filename, globals, attach)
>    1601         if len(v) > 1:
>    1602             for file in v:
> -> 1603                 load(file, globals, attach=attach)
>    1604             return
>    1605
>
> /home/punarbasu/Installations/sage-5.0.beta2/local/lib/python2.7/site-
> packages/sage/misc/preparser.pyc in load(filename, globals, attach)
>    1616
>    1617     if not is_loadable_filename(filename):
> -> 1618         raise ValueError('argument (=%r) to load or attach must
> have extension py, pyx, sage, spyx, or m' % filename)
>    1619
>    1620     fpath = os.path.expanduser(filename)
>
> ValueError: argument (='/tmp/a') to load or attach must have extension
> py, pyx, sage, spyx, or m
> }}}

New description:

 It is not possible to ''watch'' a file which has spaces in its absolute
 path. This is an example:
 {{{
 sage: f1 = 'a.sage'; open(f1,'w').write("print 'h'")
 sage: attach a.sage
 h
 sage: attach
 attach          attached_files
 sage: attached_files()
 ['/tmp/a b/a.sage']
 sage: open(f1,'w').write("print 'p'")
 sage:
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /tmp/a b/<ipython console> in <module>()

 /home/punarbasu/Installations/sage-5.0.beta2/local/lib/python2.7/site-
 packages/sage/misc/preparser.pyc in load(filename, globals, attach)
    1601         if len(v) > 1:
    1602             for file in v:
 -> 1603                 load(file, globals, attach=attach)
    1604             return
    1605

 /home/punarbasu/Installations/sage-5.0.beta2/local/lib/python2.7/site-
 packages/sage/misc/preparser.pyc in load(filename, globals, attach)
    1616
    1617     if not is_loadable_filename(filename):
 -> 1618         raise ValueError('argument (=%r) to load or attach must
 have extension py, pyx, sage, spyx, or m' % filename)
    1619
    1620     fpath = os.path.expanduser(filename)

 ValueError: argument (='/tmp/a') to load or attach must have extension py,
 pyx, sage, spyx, or m
 }}}

 ----
 Apply [attachment:trac_12671-fix-load-file-with-space-in-path.patch] to
 `devel/sage`.

--

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

Reply via email to