Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CPyCppyy] Remove implicit conversion of any ctypes ptr type to void* #16816

Merged
merged 1 commit into from
Nov 5, 2024

Commits on Nov 5, 2024

  1. [CPyCppyy] Remove implicit conversion of any ctypes ptr type to void*

    The `IsCTypesArrayOrPointer` gives false positives in Python 3.13,
    resulting the void pointer converter to take the wrong code path and
    crash. See:
    wlav/cppyy#272
    
    This code path is used for implicit conversion from other `ctypes`
    pointer types to `void*`, which is not strictly required. One can
    always do an explicit cast:  `ctypes.cast(my_ptr, ctypes.c_void_p )`.
    
    Given that this a niche feature that broke Python 3.13 support for
    functions taking `void*`, which is quite common, it can be argued that
    it's better to remove this implicit conversion.
    
    This commit fixes the following tests under Python 3.13:
    
    ```
    roottest-python-basic-datatype
    roottest-python-cpp-cpp
    ```
    
    This reverts the following commit from upstream:
    wlav/CPyCppyy@80a0205
    guitargeek committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    5beb41b View commit details
    Browse the repository at this point in the history