uerrno – 系统错误代码

该模块实现相应CPython模块的子集,如下所示,它提供了对 OSError 异常的符号错误代码的相关常量


  • 使用示例
    >>> import uerrno
    >>>
    >>> print(uerrno.ETIMEDOUT)
    116
    >>> 
    >>> print(uerrno.errorcode)
    {1: 'EPERM', 2: 'ENOENT', 5: 'EIO', 9: 'EBADF', 11: 'EAGAIN', 12: 'ENOMEM', 13: 'EACCES', 17: 'EEXIST', 19: 'ENODEV', 21: 'EISDIR', 22: 'EINVAL', 95: 'EOPNOTSUPP', 112: 'EADDRINUSE', 113: 'ECONNABORTED', 104: 'ECONNRESET', 105: 'ENOBUFS', 128: 'ENOTCONN', 116: 'ETIMEDOUT', 111: 'ECONNREFUSED', 118: 'EHOSTUNREACH', 120: 'EALREADY', 119: 'EINPROGRESS'}
    >>> 
    

常量

uerrno.errorcode
uerrno.EPERM
uerrno.ENOBUFS
uerrno.ENODEV
uerrno.ENOENT
uerrno.ENOMEM
uerrno.ENOBUFS
uerrno.ENODEV
uerrno.ENOENT
uerrno.ENOMEM
uerrno.ENOTCONN
uerrno.EOPNOTSUPP
uerrno.ETIMEDOUT
uerrno.EIO
uerrno.EAGAIN
uerrno.EACCES
uerrno.EEXIST
uerrno.EISDIR
uerrno.EINVAL
uerrno.EADDRINUSE
uerrno.ECONNABORTED
uerrno.ECONNREFUSED
uerrno.ECONNRESET
uerrno.EHOSTUNREACH
uerrno.EALREADY
uerrno.EINPROGRESS