Message3696

Author bupjae
Recipients bupjae, jy123, nriley
Date 2008-10-20.00:27:41
SpamBayes Score 2.9461635e-09
Marked as misclassified No
Message-id <1224462461.64.0.570864647527.issue1110@psf.upfronthosting.co.za>
In-reply-to
Content
Here is my workarounds

in lib\os.py:

def makedirs(path, mode='ignored'):
    """makedirs(path [, mode=0777])

    Super-mkdir; create a leaf directory and all intermediate ones.

    Works like mkdir, except that any intermediate path segment (not
    just the rightmost) will be created if it does not exist.
    The optional parameter is currently ignored.
    """
    sys_path = sys.getPath(path)
    if File(sys_path).mkdirs():
        return
    if(sys_path[-1]=='\\'):
        if File(sys_path[:-2]).mkdirs():
            return

    # if making a /x/y/z/., java.io.File#mkdirs inexplicably fails. So 
we need
    # to force it
    
    # need to use _path instead of path, because param is hiding
    # os.path module in namespace!
    head, tail = _path.split(sys_path)
    if tail == curdir:
        if File(_path.join(head)).mkdirs():
            return
        if(_path.join(head)[-1]=='\\'):
            if File(_path.join(head)[:-2]).mkdirs():
                return
                
    raise OSError(0, "couldn't make directories", path)
History
Date User Action Args
2008-10-20 00:27:41bupjaesetmessageid: <1224462461.64.0.570864647527.issue1110@psf.upfronthosting.co.za>
2008-10-20 00:27:41bupjaesetrecipients: + bupjae, nriley, jy123
2008-10-20 00:27:41bupjaelinkissue1110 messages
2008-10-20 00:27:41bupjaecreate