Skip to content

Incorrect error message for ctypes bitfield overflow #143164

Description

@hyongtao-code

Bug report

Bug description:

https://github.com/python/cpython/blob/main/Modules/_ctypes/cfield.c#L163-L164
The error message did not match the actual overflow check and omitted the bitfield size, making it misleading.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixesextension-modulesC modules in the Modules dirtopic-ctypestype-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions