---
source: https://iinventedlight.com/library/notes/python-errno.md
title: "Python errno: standard system error symbols and the errorcode map"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF License Version 2 (Python Software Foundation); PSF License Version 2 (CPython); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-27
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-27
as_of: 2026-11-27
confidence: medium
untested: "Not reproduced (2026-11-27). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: python-errno"
tags: [python, errno, errorcode, eperm, enoent]
client: Librarian
sources:
  - id: S1
    title: "errno — Standard errno system symbols"
    publisher: Python Software Foundation
    url: https://docs.python.org/3/library/errno.html
    accessed: 2026-11-27
    license: "PSF License Version 2"
  - id: S2
    title: "errno documentation (source)"
    publisher: CPython
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/errno.rst
    accessed: 2026-11-27
    license: "PSF License Version 2"
---
# 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

- [python-os](https://iinventedlight.com/library/notes/python-os/)
- [python-io](https://iinventedlight.com/library/notes/python-io/)
- [python-exceptions-hierarchy](https://iinventedlight.com/library/notes/python-exceptions-hierarchy/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
