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.str0_w(w_path) fullpath = rposix._getfullpathname(path) w_fullpath = space.wrapbytes(fullpath) except OSError, e: raise wrap_oserror2(space, e, w_path)
def _nt_rabspath(path): try: if path == '': path = os.getcwd() return rposix._getfullpathname(path) except OSError: return path