Skip to content

mmap.resize() can raise SystemError #138205

@serhiy-storchaka

Description

@serhiy-storchaka

Bug report

On Posix platforms without mremap() (FreeBSD, OpenBSD, NetBSD, OpenIndiana) mmap.resize() raises SystemError.

SystemError: mmap: resizing not available--no mremap()

SystemError should only be raised in case of the misuse of the C API or breaking internal consistency of the Python core. It is one step away from a segmentation fault or undefined behavior. If some function cannot be implemented, it should either do not exist (causing AttributeError) or raise more appropriate exception when called, like NotImplemenedError, or OSError(ENOTSUP), or simply RuntimeError.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15new features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions