Opened 8 years ago

Last modified 8 years ago

#12671 closed defect

attaching files which have spaces in absolute path name fails on second run — at Version 1

Reported by: ppurka Owned by: jason
Priority: major Milestone: sage-5.1
Component: misc Keywords: attach load preparser sd40.5
Cc: Merged in:
Authors: Punarbasu Purkayastha Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by ppurka)

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 trac_12671-fix-load-file-with-space-in-path.patch to devel/sage.

Change History (2)

comment:1 Changed 8 years ago by ppurka

  • Authors set to Punarbasu Purkayastha
  • Description modified (diff)
  • Status changed from new to needs_review

Changed 8 years ago by ppurka

Apply to devel/sage

Note: See TracTickets for help on using tickets.