Skip to content

Add structured version info for ctypes #157487

Description

@serhiy-storchaka

Feature or enhancement

ctypes exposes no information about the libffi library it is built with and running on, although libffi mismatches are a common source of platform-specific failures (test_ctypes skips are keyed on platform guesses rather than on the libffi version).

libffi 3.5 added a version API: FFI_VERSION_STRING and FFI_VERSION_NUMBER at compile time, ffi_get_version() and ffi_get_version_number() at runtime. Older versions provide nothing.

Add ctypes.LIBFFI_VERSION and ctypes.LIBFFI_VERSION_INFO for the build-time version, and ctypes.libffi_version and ctypes.libffi_version_info for the runtime version. They are only available if the module was built with libffi 3.5 or later.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.16new features, bugs and security fixesextension-modulesC modules in the Modules dirtopic-ctypestype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions