Opened 14 years ago

Closed 14 years ago

#1395 closed defect (fixed)

[with patch, with positive review] notebook(directory="foo/") misbehaves

Reported by: malb Owned by: mhansen
Priority: major Milestone: sage-2.9
Component: notebook Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

If the directory name is provied with a trailing "/" then

SAGE/local/lib/python2.5/site-packages/sage/server/notebook/notebook.py in __init__(self, dir, system, show_debug, log_server, address, port, secure, server_pool)
     59         self.__worksheet_dir = '%s/worksheets'%dir
     60         self.__object_dir    = '%s/objects'%dir
---> 61         self.__makedirs()
     62         self.__history = []
     63         self.__history_count = 0

SAGE/local/lib/python2.5/site-packages/sage/server/notebook/notebook.py in __makedirs(self)
    666     def __makedirs(self):
    667         if not os.path.exists(self.__dir):
--> 668             os.makedirs(self.__dir)
    669         if not os.path.exists(self.__worksheet_dir):
    670             os.makedirs(self.__worksheet_dir)


SAGE/local/lib/python2.5/os.py in makedirs(name, mode)
    170         if tail == curdir:           # xxx/newdir/. exists if xxx/newdir exists
    171             return
--> 172     mkdir(name, mode)
    173
    174 def removedirs(name):

<type 'exceptions.OSError'>: [Errno 2] No such file or directory: ''

This is particularly annoying because tab completion returns directory names with trailing "/".

Attachments (1)

1395.patch (1.7 KB) - added by mhansen 14 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 14 years ago by mhansen

  • Owner changed from boothby to mhansen
  • Status changed from new to assigned
  • Summary changed from notebook(directory="foo/") misbehaves to [with patch] notebook(directory="foo/") misbehaves

Changed 14 years ago by mhansen

comment:2 Changed 14 years ago by cwitty

  • Summary changed from [with patch] notebook(directory="foo/") misbehaves to [with patch, with positive review] notebook(directory="foo/") misbehaves

Looks good: code seems reasonable, and it does fix the problem.

comment:3 Changed 14 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from assigned to closed

Merged in 2.9.rc0.

Note: See TracTickets for help on using tickets.