我们从Python开源项目中,提取了以下11个代码示例,用于说明如何使用errno.EDQUOT。
def returns_sftp_error(func): def wrapped(*args, **kwargs): try: return func(*args, **kwargs) except OSError as err: LOG.debug("Error calling %s(%s, %s): %s", func, args, kwargs, err, exc_info=True) errno = err.errno if errno in {EACCES, EDQUOT, EPERM, EROFS}: return paramiko.SFTP_PERMISSION_DENIED if errno in {ENOENT, ENOTDIR}: return paramiko.SFTP_NO_SUCH_FILE return paramiko.SFTP_FAILURE except Exception as err: LOG.debug("Error calling %s(%s, %s): %s", func, args, kwargs, err, exc_info=True) return paramiko.SFTP_FAILURE return wrapped
def __init__(self, code=None, msg='Unknown error'): super(XAttrMetadataError, self).__init__(msg) self.code = code # Parsing code and msg if (self.code in (errno.ENOSPC, errno.EDQUOT) or 'No space left' in self.msg or 'Disk quota excedded' in self.msg): self.reason = 'NO_SPACE' elif self.code == errno.E2BIG or 'Argument list too long' in self.msg: self.reason = 'VALUE_TOO_LONG' else: self.reason = 'NOT_SUPPORTED'
def __init__(self, code=None, msg='Unknown error'): super(XAttrMetadataError, self).__init__(msg) self.code = code self.msg = msg # Parsing code and msg if (self.code in (errno.ENOSPC, errno.EDQUOT) or 'No space left' in self.msg or 'Disk quota excedded' in self.msg): self.reason = 'NO_SPACE' elif self.code == errno.E2BIG or 'Argument list too long' in self.msg: self.reason = 'VALUE_TOO_LONG' else: self.reason = 'NOT_SUPPORTED'