Skip to content

ffi.error: struct timeval: wrong size for field 'tv_usec' #260

@sikmir

Description

@sikmir
$ wget https://raw.githubusercontent.com/saghul/pycares/9d0d4b78d814eabe64c7aa6639337299616a360e/examples/cares-select.py
$ python3 cares-select.py
Traceback (most recent call last):
  File "./cares-select.py", line 32, in <module>
    wait_channel(channel)
    ~~~~~~~~~~~~^^^^^^^^^
  File "./cares-select.py", line 12, in wait_channel
    timeout = channel.timeout()
  File "/usr/lib/python3/dist-packages/pycares/__init__.py", line 495, in timeout
    tv = _ffi.new("struct timeval*")
ffi.error: struct timeval: wrong size for field 'tv_usec' (cdef says 4, but C compiler says 8). fix it or use "...;" as the last field in the cdef for struct timeval to make it flexible

Debian 13 (Trixie) / armhf, python3-pycares 4.4.0-2+b3, libcares2 1.34.5-1, Python 3.13.5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions