#11914: `sage -n` fails when current directory is $SAGE_ROOT/devel/sage
-----------------------+----------------------------------------------------
   Reporter:  kini     |          Owner:                          
       Type:  defect   |         Status:  new                     
   Priority:  major    |      Milestone:  sage-4.7.2              
  Component:  scripts  |       Keywords:  startup, crash, sage-env
Work_issues:           |       Upstream:  N/A                     
   Reviewer:           |         Author:                          
     Merged:           |   Dependencies:                          
-----------------------+----------------------------------------------------

Comment(by jhpalmieri):

 Or perhaps this patch to the script sage-notebook:
 {{{
 #!diff
 diff --git a/sage-notebook b/sage-notebook
 --- a/sage-notebook
 +++ b/sage-notebook
 @@ -2,6 +2,13 @@

  import os, sys, socket

 +CUR=os.path.abspath(os.curdir)
 +if os.path.samefile(CUR, os.path.join(os.environ['SAGE_ROOT'], 'devel',
 'sage')):
 +    try:
 +        sys.path.remove(CUR)
 +    except ValueError:
 +        pass
 +
  print open(os.environ['SAGE_ROOT'] + '/local/bin/sage-banner').read()

  print "Please wait while the Sage Notebook server starts..."
 }}}
 This looks safer than my first suggestion, although it could be a bit more
 refined: search sys.path not just for CUR, but for anything which is
 equivalent to CUR.

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