Skip to content

Incorrect error message for ctypes bitfield overflow #143164

@hyongtao-code

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions