Exemplo n.º 1
0
    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"))
Exemplo n.º 2
0
    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"))
Exemplo n.º 3
0
 def f():
     return rposix.stat(self.path).st_mtime
Exemplo n.º 4
0
 def f():
     return rposix.stat(self.path).st_mtime