Beispiel #1
0
def _getfullpathname(space, w_path):
    """helper for ntpath.abspath """
    try:
        if space.isinstance_w(w_path, space.w_unicode):
            path = FileEncoder(space, w_path)
            fullpath = rposix._getfullpathname(path)
            w_fullpath = space.wrap(fullpath)
        else:
            path = space.str_w(w_path)
            fullpath = rposix._getfullpathname(path)
            w_fullpath = space.wrap(fullpath)
    except OSError, e:
        raise wrap_oserror2(space, e, w_path)
Beispiel #2
0
def _getfullpathname(space, w_path):
    """helper for ntpath.abspath """
    try:
        if space.isinstance_w(w_path, space.w_unicode):
            path = FileEncoder(space, w_path)
            fullpath = rposix._getfullpathname(path)
            w_fullpath = space.wrap(fullpath)
        else:
            path = space.str_w(w_path)
            fullpath = rposix._getfullpathname(path)
            w_fullpath = space.wrap(fullpath)
    except OSError, e:
        raise wrap_oserror2(space, e, w_path)
Beispiel #3
0
 def rabspath(path):
     if path == '':
         path = os.getcwd()
     try:
         return rposix._getfullpathname(path)
     except OSError:
         return path