def _descr_init(self, space, w_path, win32): path = space.unicode0_w(w_path) if win32 else space.fsencode_w(w_path) if not path: raise OperationError(space.w_ImportError, space.wrap("empty pathname")) # Directory should not exist try: st = rposix.stat(_WIN32Path(path) if win32 else path) except OSError: pass else: if stat.S_ISDIR(st.st_mode): raise OperationError(space.w_ImportError, space.wrap("existing directory"))
def _descr_init(self, space, w_path, win32): path = space.unicode0_w(w_path) if win32 else space.fsencode_w(w_path) if not path: raise OperationError(space.w_ImportError, space.wrap( "empty pathname")) # Directory should not exist try: st = rposix.stat(_WIN32Path(path) if win32 else path) except OSError: pass else: if stat.S_ISDIR(st.st_mode): raise OperationError(space.w_ImportError, space.wrap( "existing directory"))
def f(): return rposix.stat(self.path).st_mtime