errno --- 標準 errno 系統符號


This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value. The names and descriptions are borrowed from linux/include/errno.h, which should be all-inclusive.

errno.errorcode

Dictionary providing a mapping from the errno value to the string name in the underlying system. For instance, errno.errorcode[errno.EPERM] maps to 'EPERM'.

To translate a numeric error code to an error message, use os.strerror().

Of the following list, symbols that are not used on the current platform are not defined by the module. The specific list of defined symbols is available as errno.errorcode.keys(). Symbols available can include:

errno.EPERM

Operation not permitted. This error is mapped to the exception PermissionError.

errno.ENOENT

No such file or directory. This error is mapped to the exception FileNotFoundError.

errno.ESRCH

No such process. This error is mapped to the exception ProcessLookupError.

errno.EINTR

Interrupted system call. This error is mapped to the exception InterruptedError.

errno.EIO

I/O error

errno.ENXIO

No such device or address

errno.E2BIG

Arg list too long

errno.ENOEXEC

Exec format error

errno.EBADF

Bad file number

errno.ECHILD

No child processes. This error is mapped to the exception ChildProcessError.

errno.EAGAIN

Try again. This error is mapped to the exception BlockingIOError.

errno.ENOMEM

Out of memory

errno.EACCES

Permission denied. This error is mapped to the exception PermissionError.

errno.EFAULT

Bad address

errno.ENOTBLK

Block device required

errno.EBUSY

Device or resource busy

errno.EEXIST

File exists. This error is mapped to the exception FileExistsError.

errno.EXDEV

Cross-device link

errno.ENODEV

No such device

errno.ENOTDIR

Not a directory. This error is mapped to the exception NotADirectoryError.

errno.EISDIR

Is a directory. This error is mapped to the exception IsADirectoryError.

errno.EINVAL

Invalid argument

errno.ENFILE

File table overflow

errno.EMFILE

Too many open files

errno.ENOTTY

Not a typewriter

errno.ETXTBSY

Text file busy

errno.EFBIG

File too large

errno.ENOSPC

No space left on device

errno.ESPIPE

Illegal seek

errno.EROFS

Read-only file system

Too many links

errno.EPIPE

Broken pipe. This error is mapped to the exception BrokenPipeError.

errno.EDOM

Math argument out of domain of func

errno.ERANGE

Math result not representable

errno.EDEADLK

Resource deadlock would occur

errno.ENAMETOOLONG

File name too long

errno.ENOLCK

No record locks available

errno.ENOSYS

Function not implemented

errno.ENOTEMPTY

Directory not empty

errno.