Hi

This issue is unresolved for me: users running sage -t in a system-wide
install owned by root.

On Wed, Sep 02, 2009 at 02:49:28PM +1000, Minh Nguyen wrote:
> This issue is now ticket #6861
> http://trac.sagemath.org/sage_trac/ticket/6861

# give write permissions to everyone, same as /tmp/
0 j...@muizenberg:~$ls -ld /usr/local/src/sage-4.1.1/tmp/tmp
drwxrwxrwt 2 root root 4096 2009-09-02 08:00 /usr/local/src/sage-4.1.1/tmp/tmp
# set SAGE_TESTDIR
0 j...@muizenberg:~$echo $SAGE_TESTDIR 
/home/jan/.sage/
# only absolute paths work
0 j...@muizenberg:~$sage -t dpl.sage 
ERROR: File ./dpl.sage is missing
exit code: 1
 
----------------------------------------------------------------------
The following tests failed:


        ./dpl.sage
Total time for all tests: 0.0 seconds
# still problems:
0 j...@muizenberg:~$sage -t /home/jan/dpl.sage 
sage -t  "/home/jan/dpl.sage"                               
/usr/local/src/sage-4.1.1/local/bin/sage-preparse: File file_name is missing
Traceback (most recent call last):
  File "/usr/local/src/sage-4.1.1/local/bin/sage-doctest", line 754, in <module>
    test_file(argv[1], library_code = library_code)
  File "/usr/local/src/sage-4.1.1/local/bin/sage-doctest", line 587, in 
test_file
    open(f,"w").write(s)
IOError: [Errno 13] Permission denied: './.doctest_dpl.py'
         [0.1 s]
exit code: 256
 
----------------------------------------------------------------------
The following tests failed:


        sage -t  "/home/jan/dpl.sage"
Total time for all tests: 0.1 seconds
# library_code is probably false so SAGE_TESTDIR does not get set???
0 j...@muizenberg:~$grep -B8 " f = " 
/usr/local/src/sage-4.1.1/local/bin/sage-doctest
        if library_code:
            if 'SAGE_TESTDIR' not in os.environ or os.environ['SAGE_TESTDIR'] 
is "":
                SAGE_TESTDIR = os.environ['SAGE_ROOT']+"/tmp"
            else:
                SAGE_TESTDIR = os.environ['SAGE_TESTDIR']
        else:
            SAGE_TESTDIR = '.'

        f = "%s/.doctest_%s.py"%(SAGE_TESTDIR,name)
# I test it:
0 j...@muizenberg:~$sudo vim /usr/local/src/sage-4.1.1/local/bin/sage-doctest
0 j...@muizenberg:~$grep -B10 " f = " 
/usr/local/src/sage-4.1.1/local/bin/sage-doctest
        if library_code:
            if 'SAGE_TESTDIR' not in os.environ or os.environ['SAGE_TESTDIR'] 
is "":
                SAGE_TESTDIR = os.environ['SAGE_ROOT']+"/tmp"
            else:
                SAGE_TESTDIR = os.environ['SAGE_TESTDIR']
        else:
            SAGE_TESTDIR = '.'

        ftemp="/home/jan/log"
        open(ftemp,"w").write("SAGE_TESTDIR="+SAGE_TESTDIR+"\n")
        f = "%s/.doctest_%s.py"%(SAGE_TESTDIR,name)

# And SAGE_TESTDIR is '.'
0 j...@muizenberg:~$sage -t /home/jan/dpl.sage 
sage -t  "/home/jan/dpl.sage"                               
/usr/local/src/sage-4.1.1/local/bin/sage-preparse: File file_name is missing
Traceback (most recent call last):
  File "/usr/local/src/sage-4.1.1/local/bin/sage-doctest", line 756, in <module>
    test_file(argv[1], library_code = library_code)
  File "/usr/local/src/sage-4.1.1/local/bin/sage-doctest", line 589, in 
test_file
    open(f,"w").write(s)
IOError: [Errno 13] Permission denied: './.doctest_dpl.py'
         [0.1 s]
exit code: 256
 
----------------------------------------------------------------------
The following tests failed:


        sage -t  "/home/jan/dpl.sage"
Total time for all tests: 0.1 seconds
0 j...@muizenberg:~$cat ~/log 
SAGE_TESTDIR=.
# And that absolute path is a problem later, even with insane permissions:
0 j...@muizenberg:~$sudo chmod 777 /usr/local/src/sage-4.1.1/tmp/
0 j...@muizenberg:~$sudo chmod 777 /usr/local/src/sage-4.1.1/
0 j...@muizenberg:~$sage -t /home/jan/dpl.sage 
sage -t  "/home/jan/dpl.sage"                               
/usr/local/src/sage-4.1.1/local/bin/sage-preparse: File file_name is missing
  File "./dpl.py", line 18
    from /home/jan/dpl import *
         ^
SyntaxError: invalid syntax

         [0.2 s]
exit code: 1024
 
----------------------------------------------------------------------
The following tests failed:


        sage -t  "/home/jan/dpl.sage"
Total time for all tests: 0.2 seconds

0 j...@muizenberg:~$
# but going back to relative path has the original problem:
0 j...@muizenberg:~$sage -t dpl.sage 
ERROR: File ./dpl.sage is missing
exit code: 1
 
----------------------------------------------------------------------
The following tests failed:


        ./dpl.sage
Total time for all tests: 0.0 seconds
0 j...@muizenberg:~$
# same for sudo
0 j...@muizenberg:~$sudo sage -t dpl.sage 
ERROR: File ./dpl.sage is missing
exit code: 1
 
----------------------------------------------------------------------
The following tests failed:


        ./dpl.sage
Total time for all tests: 0.0 seconds
0 j...@muizenberg:~$sudo sage -t /home/jan/dpl.sage 
sage -t  "/home/jan/dpl.sage"                               
/usr/local/src/sage-4.1.1/local/bin/sage-preparse: File file_name is missing
  File "./dpl.py", line 18
    from /home/jan/dpl import *
         ^
SyntaxError: invalid syntax

         [0.2 s]
exit code: 1024
 
----------------------------------------------------------------------
The following tests failed:


        sage -t  "/home/jan/dpl.sage"
Total time for all tests: 0.2 seconds
0 j...@muizenberg:~$




I suppose this will be added to the ticket, but for now I am willing
to add write permissions to a directory where needed. Which is it?
What is my immediate solution?

regards,
Jan
- 
   .~. 
   /V\     Jan Groenewald
  /( )\    www.aims.ac.za
  ^^-^^ 

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to