#9739: Handle duplicate file basenames when testing multiple files in parallel
-------------------------------+--------------------------------------------
   Reporter:  mpatel           |          Owner:  mvngu          
       Type:  defect           |         Status:  needs_work     
   Priority:  critical         |      Milestone:  sage-4.7.1     
  Component:  doctest          |       Keywords:  doctest scripts
Work_issues:                   |       Upstream:  N/A            
   Reviewer:  Robert Bradshaw  |         Author:  Mitesh Patel   
     Merged:                   |   Dependencies:                 
-------------------------------+--------------------------------------------

Comment(by leif):

 For the record, we already have the following in `sage/misc/misc.py`:

 {{{
 #!python
 ...
 HOSTNAME =
 socket.gethostname().replace('-','_').replace('/','_').replace('\\','_')

 LOCAL_IDENTIFIER = '%s.%s'%(HOSTNAME , os.getpid())
 ...
 try:
     DOT_SAGE = os.environ['DOT_SAGE']
 except KeyError:
     try:
         DOT_SAGE = '%s/.sage/'%os.environ['HOME']
     except KeyError:
         DOT_SAGE = '%s/.sage/'%SAGE_ROOT
 ...
 if not os.path.exists(DOT_SAGE):
     os.makedirs(DOT_SAGE)

 _mode = os.stat(DOT_SAGE)[stat.ST_MODE]
 _desired_mode = 040700     # drwx------
 if _mode != _desired_mode:
     print "Setting permissions of DOT_SAGE directory so only you can read
 and write it."
     # Change mode of DOT_SAGE.
     os.chmod(DOT_SAGE, _desired_mode)
 ...
 SAGE_TMP='%s/temp/%s/%s/'%(DOT_SAGE, HOSTNAME, os.getpid())
 if not os.path.exists(SAGE_TMP):
     try:
         os.makedirs(SAGE_TMP)
     except OSError, msg:
         print msg
         raise OSError, " ** Error trying to create the Sage tmp
 directory..."
 ...
 }}}

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