#9644: Make Sage run even when $SAGE_ROOT contains spaces
----------------------+-----------------------------------------------------
   Reporter:  mpatel  |       Owner:  jason
       Type:  defect  |      Status:  new  
   Priority:  major   |   Milestone:       
  Component:  misc    |    Keywords:       
     Author:          |    Upstream:  N/A  
   Reviewer:          |      Merged:       
Work_issues:          |  
----------------------+-----------------------------------------------------

Old description:

> Reported by Dan on [http://groups.google.com/group/sage-
> support/browse_thread/thread/3694601bc3de1a80 sage-support]:
> {{{
> This is an observation about the pre-compiled binaries for Mac OS.
>
> If the (unpacked) sage disk image directory is saved in a folder that has
> a
> space character in its name, for example:
>
> $HOME/Applications/my folder
>
> Then sage will not load properly when the "sage" executable is clicked.
> The
> terminal session begins, but the application doesn't load successfully.
>
> Changing the parent directory name to "my_folder" resolved this issue.
>
> While using space characters in directory names probably isn't all that
> common
> in UNIX or Linux installations, it is more common in Mac OS
> installations.
> Perhaps the installation instructions could be updated to mention this
> issue?
> }}}
>
> This actually appears to be a more general problem:
> {{{
> #!sh
> $ hostname
> sage.math.washington.edu
> $ pwd
> /mnt/usb1/scratch/mpatel/tmp/my sage
> $ ./sage
> Error setting environment variables by running
> /mnt/usb1/scratch/mpatel/tmp/my sage/local/bin/sage-env; possibly contact
> sage-devel (see http://groups.google.com/group/sage-devel).
> cat: /bin/sage-banner: No such file or directory
> mkdir: cannot create directory `': No such file or directory
> cp: cannot create directory `/ipython': Permission denied
> Traceback (most recent call last):
>   File "./sage-cleaner", line 25, in <module>
>     DOT_SAGE = os.environ['DOT_SAGE']
>   File "/mnt/usb1/scratch/mpatel/tmp/my
> sage/local/lib/python2.6/UserDict.py", line 22, in __getitem__
>     raise KeyError(key)
> KeyError: 'DOT_SAGE'
> **********************************************************************
> Welcome to IPython. I will try to create a personal configuration
> directory
> where you can customize many aspects of IPython's functionality in:
>
> /ipython
> Initializing from configuration /mnt/usb1/scratch/mpatel/tmp/my
> sage/local/lib/python2.6/site-packages/IPython/UserConfig
> WARNING:
>
> There was a problem with the installation:
> [Errno 13] Permission denied: '/ipython'
> Try to correct it or contact the developers if you think it's a bug.
> IPython will proceed with builtin defaults.
> Please press <RETURN> to start IPython.
> }}}

New description:

 Reported by Dan on [http://groups.google.com/group/sage-
 support/browse_thread/thread/3694601bc3de1a80 sage-support]:
 {{{
 This is an observation about the pre-compiled binaries for Mac OS.

 If the (unpacked) sage disk image directory is saved in a folder that has
 a
 space character in its name, for example:

 $HOME/Applications/my folder

 Then sage will not load properly when the "sage" executable is clicked.
 The
 terminal session begins, but the application doesn't load successfully.

 Changing the parent directory name to "my_folder" resolved this issue.

 While using space characters in directory names probably isn't all that
 common
 in UNIX or Linux installations, it is more common in Mac OS installations.
 Perhaps the installation instructions could be updated to mention this
 issue?
 }}}

 This actually appears to be a more general problem:
 {{{
 #!sh
 $ hostname
 sage.math.washington.edu
 $ pwd
 /mnt/usb1/scratch/mpatel/tmp/my sage
 $ ./sage
 Error setting environment variables by running
 /mnt/usb1/scratch/mpatel/tmp/my sage/local/bin/sage-env; possibly contact
 sage-devel (see http://groups.google.com/group/sage-devel).
 cat: /bin/sage-banner: No such file or directory
 mkdir: cannot create directory `': No such file or directory
 cp: cannot create directory `/ipython': Permission denied
 Traceback (most recent call last):
   File "./sage-cleaner", line 25, in <module>
     DOT_SAGE = os.environ['DOT_SAGE']
   File "/mnt/usb1/scratch/mpatel/tmp/my
 sage/local/lib/python2.6/UserDict.py", line 22, in __getitem__
     raise KeyError(key)
 KeyError: 'DOT_SAGE'
 **********************************************************************
 Welcome to IPython. I will try to create a personal configuration
 directory
 where you can customize many aspects of IPython's functionality in:

 /ipython
 Initializing from configuration /mnt/usb1/scratch/mpatel/tmp/my
 sage/local/lib/python2.6/site-packages/IPython/UserConfig
 WARNING:

 There was a problem with the installation:
 [Errno 13] Permission denied: '/ipython'
 Try to correct it or contact the developers if you think it's a bug.
 IPython will proceed with builtin defaults.
 Please press <RETURN> to start IPython.
 }}}

 Similar tickets: #5261 (OS X app bundles), #8303 (command-line arguments).

--

Comment(by mpatel):

 After applying
 {{{
 #!diff
 diff --git a/sage-sage b/sage-sage
 --- a/sage-sage
 +++ b/sage-sage
 @@ -127,7 +127,7 @@ usage_advanced() {
      exit 1
  }

 -. $SAGE_ROOT/local/bin/sage-env   1>/dev/null 2>/dev/null
 +. "$SAGE_ROOT/local/bin/sage-env"   1>/dev/null 2>/dev/null

  if [ $? -ne 0 ]; then
     echo "Error setting environment variables by running
 $SAGE_ROOT/local/bin/sage-env; possibly contact sage-devel (see
 http://groups.google.com/group/sage-devel)."
 }}}
 I get
 {{{
 #!python
 $ ./sage
 ----------------------------------------------------------------------
 | Sage Version 4.5.2.rc0, Release Date: 2010-07-28                   |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 **********************************************************************
 *                                                                    *
 * Warning: this is a prerelease version, and it may be unstable.     *
 *                                                                    *
 **********************************************************************
 ls: cannot access /mnt/usb1/scratch/mpatel/tmp/my: No such file or
 directory
 ls: cannot access sage/devel/sage: Not a directory
 ---------------------------------------------------------------------------
 RuntimeError                              Traceback (most recent call
 last)

 /mnt/usb1/scratch/mpatel/tmp/my sage/local/lib/python2.6/site-
 packages/IPython/ipmaker.pyc in force_import(modname)
      64         reload(sys.modules[modname])
      65     else:
 ---> 66         __import__(modname)
      67
      68

 /mnt/usb1/scratch/mpatel/tmp/my sage/ipy_profile_sage.py in <module>()
      14     from sage.misc.interpreter import attached_files
      15
 ---> 16     branch =
 sage.misc.misc.branch_current_hg_notice(sage.misc.misc.branch_current_hg())
      17     if branch:
      18         print branch

 /mnt/usb1/scratch/mpatel/tmp/my sage/local/lib/python2.6/site-
 packages/sage/misc/misc.pyc in branch_current_hg()
    1877     i = s.rfind('->')
    1878     if i == -1:
 -> 1879         raise RuntimeError, "unable to determine branch?!"
    1880     s = s[i+2:]
    1881     i = s.find('-')

 RuntimeError: unable to determine branch?!
 Error importing ipy_profile_sage - perhaps you should run %upgrade?
 WARNING: Loading of ipy_profile_sage failed.

 sage:
 }}}

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