Table 10.2. Python Standard Exceptions
Exception Name |
Description |
Exception[a]
|
root class for all exceptions |
SystemExit |
request termination of Python interpreter |
StandardError[a] |
base class for all standard built-in exceptions |
ArithmeticError[a] |
base class for all numeric calculation errors |
FloatingPointError[a] |
error in floating point calculation |
OverflowError |
calculation exceeded maximum limit for numerical type |
ZeroDivisionError |
division (or modulus) by zero error (all numeric types) |
AssertionError[a] |
failure of assert statement |
AttributeError |
no such object attribute |
EOFError |
end-of-file marker reached without input from built-in |
EnvironmentError[b]
|
base class for operating system environment errors |
IOError |
failure of input/output operation |
OSError[b] |
operating system error |
WindowsError[c]
|
MS Windows system call failure |
ImportError |
failure to import module or object |
KeyboardInterrupt |
user interrupted execution (usually by typing ^C) |
LookupError[a] |
base class for invalid data lookup errors |
IndexError |
no such index in sequence |
KeyError |
no such key in mapping |
MemoryError |
out-of-memory error (non-fatal to Python interpreter) |
NameError |
undeclared/uninitialized object (non-attribute) |
UnboundLocalError[c] |
access of an uninitialized local variable |
RuntimeError |
generic default error during execution |
NotImplementedError[b] |
unimplemented method |
SyntaxError |
error in Python syntax |
IndentationError[d]
|
improper indentation |
TableError[d] |
improper mixture of TABs and spaces |
SystemError |
generic interpreter system error |
TypeError |
invalid operation for type |
ValueError |
invalid argument given |
UnicodeError[c] |
Unicode related error |