Ticket #4354 (new defect)

Opened 3 months ago

Last modified 1 week ago

[with patch; needs review, under review by gsw] loading a file with spaces in the filename doesn't work

Reported by: anakha Assigned to: abergeron
Priority: major Milestone: sage-3.4
Component: misc Keywords:
Cc:

Description

try it at home:

$ echo 'print "ok"' > 'test file.sage'
$ sage "test file.sage"

Attachments

trac_4354.patch (15.6 kB) - added by anakha on 10/23/2008 05:57:24 PM.
sage (1.4 kB) - added by anakha on 10/23/2008 05:58:16 PM.
This goes right in $SAGE_ROOT. It's not part of any repo.
sage.2 (1.4 kB) - added by abergeron on 12/23/2008 08:18:31 PM.
trac_4354.2.patch (16.1 kB) - added by abergeron on 12/23/2008 08:37:58 PM.

Change History

10/23/2008 05:42:54 PM changed by anakha

  • owner changed from tbd to anakha.
  • component changed from algebra to misc.
  • milestone set to sage-3.2.

Crap, I need to relax on the submit button

10/23/2008 05:57:24 PM changed by anakha

  • attachment trac_4354.patch added.

10/23/2008 05:58:16 PM changed by anakha

  • attachment sage added.

This goes right in $SAGE_ROOT. It's not part of any repo.

10/23/2008 06:01:34 PM changed by anakha

  • summary changed from loading a file with spaces in the filename doesn't work to [with patch; needs review] loading a file with spaces in the filename doesn't work.

With the above patch and replacement sage script the example given should work and print 'ok'.

Be aware that if you copied the sage script somewhere (like /usr/local/bin) for convenience you need to modify that copy too. The line near the end that reads

"$SAGE_ROOT/local/bin/sage-sage" $*

needs to be replaced by

"$SAGE_ROOT/local/bin/sage-sage" "$@"

10/27/2008 05:35:07 AM changed by mvngu

For the patch sage, below are some possible fixes to the documentation. Please also refer to #1389.

1.

-echo "You must compile SAGE first using 'make' in the SAGE root directory." >&2
+echo "You must compile Sage first using 'make' in the Sage root directory." >&2


2.

-echo "(If you have already compiled SAGE, you must set the SAGE_ROOT variable in "
+echo "(If you have already compiled Sage, you must set the SAGE_ROOT variable in "


3.

-# whenver SAGE exists.
+# whenever Sage exits.

11/28/2008 06:54:32 PM changed by was

  • summary changed from [with patch; needs review] loading a file with spaces in the filename doesn't work to [with patch; needs work] loading a file with spaces in the filename doesn't work.

REFEREE:

Can you please rebase this against 3.2.1.alpha*? I tried applying and got some many failed hunks I can't go further.

sage: hg_scripts.apply('http://trac.sagemath.org/sage_trac/attachment/ticket/4354/trac_4354.patch')
Attempting to load remote file: http://trac.sagemath.org/sage_trac/attachment/ticket/4354/trac_4354.patch?format=raw
Loading: [..]
cd "/Users/wstein/sage/local/bin" && hg status
cd "/Users/wstein/sage/local/bin" && hg status
cd "/Users/wstein/sage/local/bin" && hg import   "/Users/wstein/.sage/temp/teragon_2.local/1537/tmp_0.patch"
applying /Users/wstein/.sage/temp/teragon_2.local/1537/tmp_0.patch
patching file sage-sage
Hunk #5 succeeded at 227 with fuzz 1 (offset 4 lines).
Hunk #6 succeeded at 246 with fuzz 1 (offset 4 lines).
Hunk #7 FAILED at 332
Hunk #8 FAILED at 376
Hunk #10 succeeded at 474 with fuzz 1 (offset 41 lines).
Hunk #12 succeeded at 507 with fuzz 1 (offset 41 lines).
Hunk #18 succeeded at 603 with fuzz 1 (offset 41 lines).
Hunk #20 succeeded at 647 with fuzz 1 (offset 41 lines).
Hunk #27 FAILED at 768
Hunk #28 FAILED at 794
4 out of 28 hunks FAILED -- saving rejects to file sage-sage.rej
abort: patch failed to apply

Note -- I did *read* the patch and I think it's very good. Also, I'm very glad for Mvngu's observations about all those typos, especially line -2 of SAGE_ROOT/sage. Can you fix those typos in sage too?

11/28/2008 11:16:58 PM changed by was

From patch author:

I'm kind of overloaded with work from school now, so it will have to
wait about 2 or 3 weeks.  If nobody does it before then, I'll do it.

12/23/2008 08:18:31 PM changed by abergeron

  • attachment sage.2 added.

12/23/2008 08:37:58 PM changed by abergeron

  • attachment trac_4354.2.patch added.

12/23/2008 08:40:33 PM changed by abergeron

  • owner changed from anakha to abergeron.
  • summary changed from [with patch; needs work] loading a file with spaces in the filename doesn't work to [with patch; needs review] loading a file with spaces in the filename doesn't work.
  • milestone changed from sage-3.4 to sage-3.2.3.

I'm back in buisness!

trac_4354.2.patch is a rebase against 3.2.2

sage.2 is the sage startup script with the doc changes proposed by mvngu.

12/24/2008 03:49:21 AM changed by mabshoff

  • milestone changed from sage-3.2.3 to sage-3.4.

12/29/2008 01:16:21 PM changed by GeorgSWeber

  • summary changed from [with patch; needs review] loading a file with spaces in the filename doesn't work to [with patch; needs review, under review by gsw] loading a file with spaces in the filename doesn't work.

Target time for the review: January 13th