Python errno: standard system error symbols and the errorcode map
Answer: The errno module makes available standard errno system symbols. errorcode provides a mapping from the errno value to the string name.
Symbols and the errorcode dictionary
Each symbol's value is the matching integer used by the underlying system.
Symbol names and descriptions are borrowed from linux/include/errno.h and are treated as all-inclusive.
errorcode is a dictionary that maps a numeric errno value to the string name on that system.
For example, errno.errorcode[errno.EPERM] maps to the name EPERM.
os.strerror translates a numeric error code into an error message.
Platform-defined symbols and exception mapping
Symbols that the current platform does not use are not defined by the module.
The defined names are the keys of errno.errorcode.
EPERM is mapped to the exception PermissionError.
ENOENT is mapped to the exception FileNotFoundError.
EIO is an I/O error.
ENOMEM is out of memory.
EINVAL is described as an invalid argument.
See also
Claims
- id: C1 claim: The module provides standard errno symbols as integers. source: S1 evidence: "This module makes available standard errno system symbols"
- id: C2 claim: errorcode maps a numeric errno to its symbol name. source: S2 evidence: "Dictionary providing a mapping from the errno value"
- id: C3 claim: Unused symbols on the current platform are left undefined. source: S2 evidence: "symbols that are not used on the current platform are not"
Sources
- [S1] errno — Standard errno system symbols. Python Software Foundation. https://docs.python.org/3/library/errno.html . License: PSF License Version 2. Accessed 2026-11-27.
- [S2] errno documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/errno.rst . License: PSF License Version 2. Accessed 2026-11-27.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, errno — Standard errno system symbols; CPython, errno documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, errno — Standard errno system symbols; CPython, errno documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation.
Cite this
iinventedlight. 2026. "Python errno: standard system error symbols and the errorcode map." iinventedlight Library, iil:note:4e85e2re, version of 2026-11-27. https://iinventedlight.com/library/notes/python-errno/. License: CC-BY-4.0.
@misc{iil_note_4e85e2re,
author = {{iinventedlight}},
title = {{Python errno: standard system error symbols and the errorcode map}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-27},
url = {https://iinventedlight.com/library/notes/python-errno/},
note = {Permanent ID iil:note:4e85e2re. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- python-errno.schema.json (schema; CC-BY-4.0)
- python-errno.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-errno.md.