sftp_client.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:watchmen 作者: lycclsltt 项目源码 文件源码
def _convert_status(self, msg):
        """
        Raises EOFError or IOError on error status; otherwise does nothing.
        """
        code = msg.get_int()
        text = msg.get_string()
        if code == SFTP_OK:
            return
        elif code == SFTP_EOF:
            raise EOFError(text)
        elif code == SFTP_NO_SUCH_FILE:
            # clever idea from john a. meinel: map the error codes to errno
            raise IOError(errno.ENOENT, text)
        elif code == SFTP_PERMISSION_DENIED:
            raise IOError(errno.EACCES, text)
        else:
            raise IOError(text)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号