Skip to content

uctypes does not support values larger than 31 bits despite listing uint64 support #2269

@ryannathans

Description

@ryannathans
>>> struct = uctypes.struct(uctypes.addressof(buffer), {"bug": uctypes.UINT32 | 0, "bug64": uctypes.UINT64 | 4})
>>> struct.bug = 2147483647
>>> struct.bug = 2147483648
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: overflow converting long int to machine word
>>> struct.bug64 = 2147483647
>>> struct.bug64 = 2147483648
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: overflow converting long int to machine word

Seems pretty funny how ctypes can't support UINT32 and UINT64s?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions