1:mod:`errno` --- Standard errno system symbols
2==============================================
3
4.. module:: errno
5   :synopsis: Standard errno system symbols.
6
7----------------
8
9This module makes available standard ``errno`` system symbols. The value of each
10symbol is the corresponding integer value. The names and descriptions are
11borrowed from :file:`linux/include/errno.h`, which should be
12all-inclusive.
13
14
15.. data:: errorcode
16
17   Dictionary providing a mapping from the errno value to the string name in the
18   underlying system.  For instance, ``errno.errorcode[errno.EPERM]`` maps to
19   ``'EPERM'``.
20
21To translate a numeric error code to an error message, use :func:`os.strerror`.
22
23Of the following list, symbols that are not used on the current platform are not
24defined by the module.  The specific list of defined symbols is available as
25``errno.errorcode.keys()``.  Symbols available can include:
26
27
28.. data:: EPERM
29
30   Operation not permitted. This error is mapped to the exception
31   :exc:`PermissionError`.
32
33
34.. data:: ENOENT
35
36   No such file or directory. This error is mapped to the exception
37   :exc:`FileNotFoundError`.
38
39
40.. data:: ESRCH
41
42   No such process. This error is mapped to the exception
43   :exc:`ProcessLookupError`.
44
45
46.. data:: EINTR
47
48   Interrupted system call. This error is mapped to the exception
49   :exc:`InterruptedError`.
50
51
52.. data:: EIO
53
54   I/O error
55
56
57.. data:: ENXIO
58
59   No such device or address
60
61
62.. data:: E2BIG
63
64   Arg list too long
65
66
67.. data:: ENOEXEC
68
69   Exec format error
70
71
72.. data:: EBADF
73
74   Bad file number
75
76
77.. data:: ECHILD
78
79   No child processes. This error is mapped to the exception
80   :exc:`ChildProcessError`.
81
82
83.. data:: EAGAIN
84
85   Try again. This error is mapped to the exception :exc:`BlockingIOError`.
86
87
88.. data:: ENOMEM
89
90   Out of memory
91
92
93.. data:: EACCES
94
95   Permission denied.  This error is mapped to the exception
96   :exc:`PermissionError`.
97
98
99.. data:: EFAULT
100
101   Bad address
102
103
104.. data:: ENOTBLK
105
106   Block device required
107
108
109.. data:: EBUSY
110
111   Device or resource busy
112
113
114.. data:: EEXIST
115
116   File exists. This error is mapped to the exception
117   :exc:`FileExistsError`.
118
119
120.. data:: EXDEV
121
122   Cross-device link
123
124
125.. data:: ENODEV
126
127   No such device
128
129
130.. data:: ENOTDIR
131
132   Not a directory. This error is mapped to the exception
133   :exc:`NotADirectoryError`.
134
135
136.. data:: EISDIR
137
138   Is a directory. This error is mapped to the exception
139   :exc:`IsADirectoryError`.
140
141
142.. data:: EINVAL
143
144   Invalid argument
145
146
147.. data:: ENFILE
148
149   File table overflow
150
151
152.. data:: EMFILE
153
154   Too many open files
155
156
157.. data:: ENOTTY
158
159   Not a typewriter
160
161
162.. data:: ETXTBSY
163
164   Text file busy
165
166
167.. data:: EFBIG
168
169   File too large
170
171
172.. data:: ENOSPC
173
174   No space left on device
175
176
177.. data:: ESPIPE
178
179   Illegal seek
180
181
182.. data:: EROFS
183
184   Read-only file system
185
186
187.. data:: EMLINK
188
189   Too many links
190
191
192.. data:: EPIPE
193
194   Broken pipe. This error is mapped to the exception
195   :exc:`BrokenPipeError`.
196
197
198.. data:: EDOM
199
200   Math argument out of domain of func
201
202
203.. data:: ERANGE
204
205   Math result not representable
206
207
208.. data:: EDEADLK
209
210   Resource deadlock would occur
211
212
213.. data:: ENAMETOOLONG
214
215   File name too long
216
217
218.. data:: ENOLCK
219
220   No record locks available
221
222
223.. data:: ENOSYS
224
225   Function not implemented
226
227
228.. data:: ENOTEMPTY
229
230   Directory not empty
231
232
233.. data:: ELOOP
234
235   Too many symbolic links encountered
236
237
238.. data:: EWOULDBLOCK
239
240   Operation would block. This error is mapped to the exception
241   :exc:`BlockingIOError`.
242
243
244.. data:: ENOMSG
245
246   No message of desired type
247
248
249.. data:: EIDRM
250
251   Identifier removed
252
253
254.. data:: ECHRNG
255
256   Channel number out of range
257
258
259.. data:: EL2NSYNC
260
261   Level 2 not synchronized
262
263
264.. data:: EL3HLT
265
266   Level 3 halted
267
268
269.. data:: EL3RST
270
271   Level 3 reset
272
273
274.. data:: ELNRNG
275
276   Link number out of range
277
278
279.. data:: EUNATCH
280
281   Protocol driver not attached
282
283
284.. data:: ENOCSI
285
286   No CSI structure available
287
288
289.. data:: EL2HLT
290
291   Level 2 halted
292
293
294.. data:: EBADE
295
296   Invalid exchange
297
298
299.. data:: EBADR
300
301   Invalid request descriptor
302
303
304.. data:: EXFULL
305
306   Exchange full
307
308
309.. data:: ENOANO
310
311   No anode
312
313
314.. data:: EBADRQC
315
316   Invalid request code
317
318
319.. data:: EBADSLT
320
321   Invalid slot
322
323
324.. data:: EDEADLOCK
325
326   File locking deadlock error
327
328
329.. data:: EBFONT
330
331   Bad font file format
332
333
334.. data:: ENOSTR
335
336   Device not a stream
337
338
339.. data:: ENODATA
340
341   No data available
342
343
344.. data:: ETIME
345
346   Timer expired
347
348
349.. data:: ENOSR
350
351   Out of streams resources
352
353
354.. data:: ENONET
355
356   Machine is not on the network
357
358
359.. data:: ENOPKG
360
361   Package not installed
362
363
364.. data:: EREMOTE
365
366   Object is remote
367
368
369.. data:: ENOLINK
370
371   Link has been severed
372
373
374.. data:: EADV
375
376   Advertise error
377
378
379.. data:: ESRMNT
380
381   Srmount error
382
383
384.. data:: ECOMM
385
386   Communication error on send
387
388
389.. data:: EPROTO
390
391   Protocol error
392
393
394.. data:: EMULTIHOP
395
396   Multihop attempted
397
398
399.. data:: EDOTDOT
400
401   RFS specific error
402
403
404.. data:: EBADMSG
405
406   Not a data message
407
408
409.. data:: EOVERFLOW
410
411   Value too large for defined data type
412
413
414.. data:: ENOTUNIQ
415
416   Name not unique on network
417
418
419.. data:: EBADFD
420
421   File descriptor in bad state
422
423
424.. data:: EREMCHG
425
426   Remote address changed
427
428
429.. data:: ELIBACC
430
431   Can not access a needed shared library
432
433
434.. data:: ELIBBAD
435
436   Accessing a corrupted shared library
437
438
439.. data:: ELIBSCN
440
441   .lib section in a.out corrupted
442
443
444.. data:: ELIBMAX
445
446   Attempting to link in too many shared libraries
447
448
449.. data:: ELIBEXEC
450
451   Cannot exec a shared library directly
452
453
454.. data:: EILSEQ
455
456   Illegal byte sequence
457
458
459.. data:: ERESTART
460
461   Interrupted system call should be restarted
462
463
464.. data:: ESTRPIPE
465
466   Streams pipe error
467
468
469.. data:: EUSERS
470
471   Too many users
472
473
474.. data:: ENOTSOCK
475
476   Socket operation on non-socket
477
478
479.. data:: EDESTADDRREQ
480
481   Destination address required
482
483
484.. data:: EMSGSIZE
485
486   Message too long
487
488
489.. data:: EPROTOTYPE
490
491   Protocol wrong type for socket
492
493
494.. data:: ENOPROTOOPT
495
496   Protocol not available
497
498
499.. data:: EPROTONOSUPPORT
500
501   Protocol not supported
502
503
504.. data:: ESOCKTNOSUPPORT
505
506   Socket type not supported
507
508
509.. data:: EOPNOTSUPP
510
511   Operation not supported on transport endpoint
512
513
514.. data:: EPFNOSUPPORT
515
516   Protocol family not supported
517
518
519.. data:: EAFNOSUPPORT
520
521   Address family not supported by protocol
522
523
524.. data:: EADDRINUSE
525
526   Address already in use
527
528
529.. data:: EADDRNOTAVAIL
530
531   Cannot assign requested address
532
533
534.. data:: ENETDOWN
535
536   Network is down
537
538
539.. data:: ENETUNREACH
540
541   Network is unreachable
542
543
544.. data:: ENETRESET
545
546   Network dropped connection because of reset
547
548
549.. data:: ECONNABORTED
550
551   Software caused connection abort. This error is mapped to the
552   exception :exc:`ConnectionAbortedError`.
553
554
555.. data:: ECONNRESET
556
557   Connection reset by peer. This error is mapped to the exception
558   :exc:`ConnectionResetError`.
559
560
561.. data:: ENOBUFS
562
563   No buffer space available
564
565
566.. data:: EISCONN
567
568   Transport endpoint is already connected
569
570
571.. data:: ENOTCONN
572
573   Transport endpoint is not connected
574
575
576.. data:: ESHUTDOWN
577
578   Cannot send after transport endpoint shutdown. This error is mapped
579   to the exception :exc:`BrokenPipeError`.
580
581
582.. data:: ETOOMANYREFS
583
584   Too many references: cannot splice
585
586
587.. data:: ETIMEDOUT
588
589   Connection timed out. This error is mapped to the exception
590   :exc:`TimeoutError`.
591
592
593.. data:: ECONNREFUSED
594
595   Connection refused. This error is mapped to the exception
596   :exc:`ConnectionRefusedError`.
597
598
599.. data:: EHOSTDOWN
600
601   Host is down
602
603
604.. data:: EHOSTUNREACH
605
606   No route to host
607
608
609.. data:: EALREADY
610
611   Operation already in progress. This error is mapped to the
612   exception :exc:`BlockingIOError`.
613
614
615.. data:: EINPROGRESS
616
617   Operation now in progress. This error is mapped to the exception
618   :exc:`BlockingIOError`.
619
620
621.. data:: ESTALE
622
623   Stale NFS file handle
624
625
626.. data:: EUCLEAN
627
628   Structure needs cleaning
629
630
631.. data:: ENOTNAM
632
633   Not a XENIX named type file
634
635
636.. data:: ENAVAIL
637
638   No XENIX semaphores available
639
640
641.. data:: EISNAM
642
643   Is a named type file
644
645
646.. data:: EREMOTEIO
647
648   Remote I/O error
649
650
651.. data:: EDQUOT
652
653   Quota exceeded
654
655.. data:: EQFULL
656
657   Interface output queue is full
658
659   .. versionadded:: 3.11
660
661.. data:: ENOTCAPABLE
662
663   Capabilities insufficient. This error is mapped to the exception
664   :exc:`PermissionError`.
665
666   .. availability:: WASI, FreeBSD
667
668   .. versionadded:: 3.11.1
669