~$ python Python 2.7.17 (default, Nov 7 2019, 10:07:09) [GCC 7.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. ------------------------------------------------------------------------------------------------------ I'm new to python, so I don't know if the following interpreter instructions are good. please confirm. ------------------------------------------------------------------------------------------------------ >>> import os >>> for n in range(135): ... if n < 10: ... print " ", n, os.strerror(n) ... elif n < 100: ... print " ", n, os.strerror(n) ... else: ... print "", n, os.strerror(n) ... 0 Success 1 Operation not permitted 2 No such file or directory 3 No such process 4 Interrupted system call 5 Input/output error 6 No such device or address 7 Argument list too long 8 Exec format error 9 Bad file descriptor 10 No child processes 11 Resource temporarily unavailable 12 Cannot allocate memory 13 Permission denied 14 Bad address 15 Block device required 16 Device or resource busy 17 File exists 18 Invalid cross-device link 19 No such device 20 Not a directory 21 Is a directory 22 Invalid argument 23 Too many open files in system 24 Too many open files 25 Inappropriate ioctl for device 26 Text file busy 27 File too large 28 No space left on device 29 Illegal seek 30 Read-only file system 31 Too many links 32 Broken pipe 33 Numerical argument out of domain 34 Numerical result out of range 35 Resource deadlock avoided 36 File name too long 37 No locks available 38 Function not implemented 39 Directory not empty 40 Too many levels of symbolic links 41 Unknown error 41 42 No message of desired type 43 Identifier removed 44 Channel number out of range 45 Level 2 not synchronized 46 Level 3 halted 47 Level 3 reset 48 Link number out of range 49 Protocol driver not attached 50 No CSI structure available 51 Level 2 halted 52 Invalid exchange 53 Invalid request descriptor 54 Exchange full 55 No anode 56 Invalid request code 57 Invalid slot 58 Unknown error 58 59 Bad font file format 60 Device not a stream 61 No data available 62 Timer expired 63 Out of streams resources 64 Machine is not on the network 65 Package not installed 66 Object is remote 67 Link has been severed 68 Advertise error 69 Srmount error 70 Communication error on send 71 Protocol error 72 Multihop attempted 73 RFS specific error 74 Bad message 75 Value too large for defined data type 76 Name not unique on network 77 File descriptor in bad state 78 Remote address changed 79 Can not access a needed shared library 80 Accessing a corrupted shared library 81 .lib section in a.out corrupted 82 Attempting to link in too many shared libraries 83 Cannot exec a shared library directly 84 Invalid or incomplete multibyte or wide character 85 Interrupted system call should be restarted 86 Streams pipe error 87 Too many users 88 Socket operation on non-socket 89 Destination address required 90 Message too long 91 Protocol wrong type for socket 92 Protocol not available 93 Protocol not supported 94 Socket type not supported 95 Operation not supported 96 Protocol family not supported 97 Address family not supported by protocol 98 Address already in use 99 Cannot assign requested address 100 Network is down 101 Network is unreachable 102 Network dropped connection on reset 103 Software caused connection abort 104 Connection reset by peer 105 No buffer space available 106 Transport endpoint is already connected 107 Transport endpoint is not connected 108 Cannot send after transport endpoint shutdown 109 Too many references: cannot splice 110 Connection timed out 111 Connection refused 112 Host is down 113 No route to host 114 Operation already in progress 115 Operation now in progress 116 Stale file handle 117 Structure needs cleaning 118 Not a XENIX named type file 119 No XENIX semaphores available 120 Is a named type file 121 Remote I/O error 122 Disk quota exceeded 123 No medium found 124 Wrong medium type 125 Operation canceled 126 Required key not available 127 Key has expired 128 Key has been revoked 129 Key was rejected by service 130 Owner died 131 State not recoverable 132 Operation not possible due to RF-kill 133 Memory page has hardware error 134 Unknown error 134 ------------------------------------------------------------------------------------------------------ Description: Ubuntu 18.04.4 LTS Created on February 24, 2020. (My environment) Linux 4.15.0-88-generic x86_64 GNU/Linux gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1) stable release version 2.27. ------------------------------------------------------------------------------------------------------ (The error name is prepended to the error message) Python 2.7.17 Standard Library 15.16 errno Error-name errno Error-message Same for "Python 3.8.2rc2 Standard Library errno" ------------------------------------------------------------------------------------------------------ Symbol errno Error-Message Start // (==:same, --:undefined) 0 Success EPERM 1 Operation not permitted // == ENOENT 2 No such file or directory // == ESRCH 3 No such process // == EINTR 4 Interrupted system call // == EIO 5 Input/output error // I/O error ENXIO 6 No such device or address // == E2BIG 7 Argument list too long // Arg list too long ENOEXEC 8 Exec format error // == EBADF 9 Bad file descriptor // Bad file number ECHILD 10 No child processes // == EAGAIN 11 Resource temporarily unavailable // Try again ENOMEM 12 Cannot allocate memory // Out of memory EACCES 13 Permission denied // == EFAULT 14 Bad address // == ENOTBLK 15 Block device required // == EBUSY 16 Device or resource busy // == EEXIST 17 File exists // == EXDEV 18 Invalid cross-device link // Cross-device link ENODEV 19 No such device // == ENOTDIR 20 Not a directory // == EISDIR 21 Is a directory // == EINVAL 22 Invalid argument // == ENFILE 23 Too many open files in system // File table overflow EMFILE 24 Too many open files // == ENOTTY 25 Inappropriate ioctl for device // Not a typewriter ETXTBSY 26 Text file busy // == EFBIG 27 File too large // == ENOSPC 28 No space left on device // == ESPIPE 29 Illegal seek // == EROFS 30 Read-only file system // == EMLINK 31 Too many links // == EPIPE 32 Broken pipe // == EDOM 33 Numerical argument out of domain // Math argument out of domain of func ERANGE 34 Numerical result out of range // Math result not representable EDEADLK 35 Resource deadlock avoided // Resource deadlock would occur ENAMETOOLONG 36 File name too long // == ENOLCK 37 No locks available // No record locks available ENOSYS 38 Function not implemented // == ENOTEMPTY 39 Directory not empty // == ELOOP 40 Too many levels of symbolic links // Too many symbolic links encountered EWOULDBLOCK 41 Unknown error 41 // Operation would block ENOMSG 42 No message of desired type // == EIDRM 43 Identifier removed // == ECHRNG 44 Channel number out of range // == EL2NSYNC 45 Level 2 not synchronized // == EL3HLT 46 Level 3 halted // == EL3RST 47 Level 3 reset // == ELNRNG 48 Link number out of range // == EUNATCH 49 Protocol driver not attached // == ENOCSI 50 No CSI structure available // == EL2HLT 51 Level 2 halted // == EBADE 52 Invalid exchange // == EBADR 53 Invalid request descriptor // == EXFULL 54 Exchange full // == ENOANO 55 No anode // == EBADRQC 56 Invalid request code // == EBADSLT 57 Invalid slot // == EDEADLOCK 58 Unknown error 58 // File locking deadlock error EBFONT 59 Bad font file format // == ENOSTR 60 Device not a stream // == ENODATA 61 No data available // == ETIME 62 Timer expired // == ENOSR 63 Out of streams resources // == ENONET 64 Machine is not on the network // == ENOPKG 65 Package not installed // == EREMOTE 66 Object is remote // == ENOLINK 67 Link has been severed // == EADV 68 Advertise error // == ESRMNT 69 Srmount error // == ECOMM 70 Communication error on send // == EPROTO 71 Protocol error // == EMULTIHOP 72 Multihop attempted // == EDOTDOT 73 RFS specific error // == EBADMSG 74 Bad message // Not a data message EOVERFLOW 75 Value too large for defined data type // == ENOTUNIQ 76 Name not unique on network // == EBADFD 77 File descriptor in bad state // == EREMCHG 78 Remote address changed // == ELIBACC 79 Can not access a needed shared library // == ELIBBAD 80 Accessing a corrupted shared library // == ELIBSCN 81 .lib section in a.out corrupted // == ELIBMAX 82 Attempting to link in too many shared libraries // == ELIBEXEC 83 Cannot exec a shared library directly // == EILSEQ 84 Invalid or incomplete multibyte or wide character // Illegal byte sequence ERESTART 85 Interrupted system call should be restarted // == ESTRPIPE 86 Streams pipe error // == EUSERS 87 Too many users // == ENOTSOCK 88 Socket operation on non-socket // == EDESTADDRREQ 89 Destination address required // == EMSGSIZE 90 Message too long // == EPROTOTYPE 91 Protocol wrong type for socket // == ENOPROTOOPT 92 Protocol not available // == EPROTONOSUPPORT 93 Protocol not supported // == ESOCKTNOSUPPORT 94 Socket type not supported // == EOPNOTSUPP 95 Operation not supported // Operation not supported on transport endpoint EPFNOSUPPORT 96 Protocol family not supported // == EAFNOSUPPORT 97 Address family not supported by protocol // == EADDRINUSE 98 Address already in use // == EADDRNOTAVAIL 99 Cannot assign requested address // == ENETDOWN 100 Network is down // == ENETUNREACH 101 Network is unreachable // == ENETRESET 102 Network dropped connection on reset // Network dropped connection because of reset ECONNABORTED 103 Software caused connection abort // == ECONNRESET 104 Connection reset by peer // == ENOBUFS 105 No buffer space available // == EISCONN 106 Transport endpoint is already connected // == ENOTCONN 107 Transport endpoint is not connected // == ESHUTDOWN 108 Cannot send after transport endpoint shutdown // == ETOOMANYREFS 109 Too many references: cannot splice // == ETIMEDOUT 110 Connection timed out // == ECONNREFUSED 111 Connection refused // == EHOSTDOWN 112 Host is down // == EHOSTUNREACH 113 No route to host // == EALREADY 114 Operation already in progress // == EINPROGRESS 115 Operation now in progress // == ESTALE 116 Stale file handle // Stale NFS file handle EUCLEAN 117 Structure needs cleaning // == ENOTNAM 118 Not a XENIX named type file // == ENAVAIL 119 No XENIX semaphores available // == EISNAM 120 Is a named type file // == EREMOTEIO 121 Remote I/O error // == EDQUOT 122 Disk quota exceeded // Quota exceeded ENOMEDIUM 123 No medium found // -- EMEDIUMTYPE 124 Wrong medium type // -- ECANCELED 125 Operation canceled // -- ENOKEY 126 Required key not available // -- EKEYEXPIRED 127 Key has expired // -- EKEYREVOKED 128 Key has been revoked // -- EKEYREJECTED 129 Key was rejected by service // -- EOWNERDEAD 130 Owner died // -- ENOTRECOVERABLE 131 State not recoverable // -- ERFKILL 132 Operation not possible due to RF-kill // -- EHWPOISON 133 Memory page has hardware error // -- Symbol errno Error-Message End // (==:same, --:undefined) ------------------------------------------------------------------------------------------------------ ~$ sort -b -k 1 python-no.txt > python-no-sort.txt -- This is created for comparison with errno (3). (almost the same) ------------------------------------------------------------------------------------------------------ Symbol errno Error-Message Start 0 Success E2BIG 7 Argument list too long EACCES 13 Permission denied EADDRINUSE 98 Address already in use EADDRNOTAVAIL 99 Cannot assign requested address EADV 68 Advertise error EAFNOSUPPORT 97 Address family not supported by protocol EAGAIN 11 Resource temporarily unavailable EALREADY 114 Operation already in progress EBADE 52 Invalid exchange EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state EBADMSG 74 Bad message EBADR 53 Invalid request descriptor EBADRQC 56 Invalid request code EBADSLT 57 Invalid slot EBFONT 59 Bad font file format EBUSY 16 Device or resource busy ECANCELED 125 Operation canceled ECHILD 10 No child processes ECHRNG 44 Channel number out of range ECOMM 70 Communication error on send ECONNABORTED 103 Software caused connection abort ECONNREFUSED 111 Connection refused ECONNRESET 104 Connection reset by peer EDEADLK 35 Resource deadlock avoided EDEADLOCK 58 Unknown error 58 EDESTADDRREQ 89 Destination address required EDOM 33 Numerical argument out of domain EDOTDOT 73 RFS specific error EDQUOT 122 Disk quota exceeded EEXIST 17 File exists EFAULT 14 Bad address EFBIG 27 File too large EHOSTDOWN 112 Host is down EHOSTUNREACH 113 No route to host EHWPOISON 133 Memory page has hardware error EIDRM 43 Identifier removed EILSEQ 84 Invalid or incomplete multibyte or wide character EINPROGRESS 115 Operation now in progress EINTR 4 Interrupted system call EINVAL 22 Invalid argument EIO 5 Input/output error EISCONN 106 Transport endpoint is already connected EISDIR 21 Is a directory EISNAM 120 Is a named type file EKEYEXPIRED 127 Key has expired EKEYREJECTED 129 Key was rejected by service EKEYREVOKED 128 Key has been revoked EL2HLT 51 Level 2 halted EL2NSYNC 45 Level 2 not synchronized EL3HLT 46 Level 3 halted EL3RST 47 Level 3 reset ELIBACC 79 Can not access a needed shared library ELIBBAD 80 Accessing a corrupted shared library ELIBEXEC 83 Cannot exec a shared library directly ELIBMAX 82 Attempting to link in too many shared libraries ELIBSCN 81 .lib section in a.out corrupted ELNRNG 48 Link number out of range ELOOP 40 Too many levels of symbolic links EMEDIUMTYPE 124 Wrong medium type EMFILE 24 Too many open files EMLINK 31 Too many links EMSGSIZE 90 Message too long EMULTIHOP 72 Multihop attempted ENAMETOOLONG 36 File name too long ENAVAIL 119 No XENIX semaphores available ENETDOWN 100 Network is down ENETRESET 102 Network dropped connection on reset ENETUNREACH 101 Network is unreachable ENFILE 23 Too many open files in system ENOANO 55 No anode ENOBUFS 105 No buffer space available ENOCSI 50 No CSI structure available ENODATA 61 No data available ENODEV 19 No such device ENOENT 2 No such file or directory ENOEXEC 8 Exec format error ENOKEY 126 Required key not available ENOLCK 37 No locks available ENOLINK 67 Link has been severed ENOMEDIUM 123 No medium found ENOMEM 12 Cannot allocate memory ENOMSG 42 No message of desired type ENONET 64 Machine is not on the network ENOPKG 65 Package not installed ENOPROTOOPT 92 Protocol not available ENOSPC 28 No space left on device ENOSR 63 Out of streams resources ENOSTR 60 Device not a stream ENOSYS 38 Function not implemented ENOTBLK 15 Block device required ENOTCONN 107 Transport endpoint is not connected ENOTDIR 20 Not a directory ENOTEMPTY 39 Directory not empty ENOTNAM 118 Not a XENIX named type file ENOTRECOVERABLE 131 State not recoverable ENOTSOCK 88 Socket operation on non-socket ENOTTY 25 Inappropriate ioctl for device ENOTUNIQ 76 Name not unique on network ENXIO 6 No such device or address EOPNOTSUPP 95 Operation not supported EOVERFLOW 75 Value too large for defined data type EOWNERDEAD 130 Owner died EPERM 1 Operation not permitted EPFNOSUPPORT 96 Protocol family not supported EPIPE 32 Broken pipe EPROTO 71 Protocol error EPROTONOSUPPORT 93 Protocol not supported EPROTOTYPE 91 Protocol wrong type for socket ERANGE 34 Numerical result out of range EREMCHG 78 Remote address changed EREMOTE 66 Object is remote EREMOTEIO 121 Remote I/O error ERESTART 85 Interrupted system call should be restarted ERFKILL 132 Operation not possible due to RF-kill EROFS 30 Read-only file system ESHUTDOWN 108 Cannot send after transport endpoint shutdown ESOCKTNOSUPPORT 94 Socket type not supported ESPIPE 29 Illegal seek ESRCH 3 No such process ESRMNT 69 Srmount error ESTALE 116 Stale file handle ESTRPIPE 86 Streams pipe error ETIME 62 Timer expired ETIMEDOUT 110 Connection timed out ETOOMANYREFS 109 Too many references: cannot splice ETXTBSY 26 Text file busy EUCLEAN 117 Structure needs cleaning EUNATCH 49 Protocol driver not attached EUSERS 87 Too many users EWOULDBLOCK 41 Unknown error 41 EXDEV 18 Invalid cross-device link EXFULL 54 Exchange full Symbol errno Error-Message End ------------------------------------------------------------------------------------------------------