EC
🐍

Python Built-in Exceptions

Python 3.1275 codes

Built-in exceptions, warnings, and stdlib errors

Showing 75 of 75 errors
CodeMessage
SyntaxErrorInvalid syntax→
IndentationErrorIncorrect indentation→
NameErrorName not found in local or global scope→
TypeErrorOperation applied to object of wrong type→
ValueErrorFunction argument has right type but inappropriate value→
AttributeErrorObject does not have the specified attribute→
KeyErrorDictionary key not found→
IndexErrorSequence index out of range→
ImportErrorCould not import module or member→
ModuleNotFoundErrorModule not found→
OSErrorOperating system-related error→
FileNotFoundErrorFile or directory not found→
PermissionErrorOperation not permitted→
RuntimeErrorError doesn't fall in other categories→
RecursionErrorMaximum recursion depth exceeded→
StopIterationIterator has no more items→
GeneratorExitGenerator's close() method was called→
SystemExitProgram exited (sys.exit() called)β†’
KeyboardInterruptUser pressed Ctrl+C→
MemoryErrorOperation ran out of memory→
OverflowErrorResult of an arithmetic operation is too large to be represented→
ZeroDivisionErrorDivision or modulo by zero→
UnicodeDecodeErrorUnicode decoding error→
UnicodeEncodeErrorUnicode encoding error→
AssertionErrorAssertion statement failed→
NotImplementedErrorAbstract method not implemented→
TimeoutErrorOperation timed out→
ConnectionErrorConnection-related error→
BrokenPipeErrorPipe is broken→
IsADirectoryErrorOperation expected a file, but got a directory→
EOFErrorEnd of file reached→
UnboundLocalErrorLocal variable referenced before assignment→
FloatingPointErrorFloating-point operation failed→
BufferErrorBuffer operation failed→
StopAsyncIterationAsync iterator exhausted→
BlockingIOErrorNon-blocking I/O would block→
ChildProcessErrorChild process operation failed→
ConnectionAbortedErrorConnection aborted by peer→
ConnectionRefusedErrorConnection refused by server→
ConnectionResetErrorConnection reset by peer→
FileExistsErrorFile or directory already exists→
InterruptedErrorSystem call interrupted by signal→
NotADirectoryErrorNot a directory→
ProcessLookupErrorProcess not found→
ReferenceErrorWeak reference expired→
SystemErrorInternal Python interpreter error→
TabErrorInconsistent use of tabs and spaces→
UnicodeTranslateErrorUnicode translation failed→
ExceptionGroupMultiple exceptions raised simultaneously→
DeprecationWarningDeprecated feature used→
ResourceWarningUnclosed resource→
RuntimeWarningSuspicious runtime behaviour→
UserWarningUser-issued warning→
json.JSONDecodeErrorInvalid JSON→
subprocess.CalledProcessErrorCalled process returned non-zero exit code→
subprocess.TimeoutExpiredSubprocess timed out→
re.errorInvalid regular expression→
asyncio.CancelledErrorAsync task was cancelled→
ssl.SSLErrorTLS/SSL certificate or handshake error→
pickle.PicklingErrorObject cannot be pickled→
struct.errorBinary struct pack/unpack failed→
io.UnsupportedOperationI/O operation not supported→
EncodingWarningLocale or encoding mismatch detected→
FutureWarningBehaviour will change in a future Python release→
PendingDeprecationWarningFeature may be deprecated in a future release→
ImportWarningProbable mistake in module import→
SyntaxWarningDubious or potentially invalid syntax→
UnicodeWarningUnicode comparison or conversion issue→
BytesWarningBytes or buffer compared with str→
BaseExceptionGroupGroup of BaseException instances (Python 3.11+)β†’
urllib.error.URLErrorURL request failed — network or DNS error→
http.client.HTTPExceptionLow-level HTTP protocol error→
csv.ErrorCSV parsing or writing error→
zipfile.BadZipFileZIP file is corrupt or not a valid ZIP→
socket.errorSocket-level network error (alias for OSError)β†’