kivy-ios icon indicating copy to clipboard operation
kivy-ios copied to clipboard

Ctypes.CFUNCTYPE needs patching for iOS

Open akshayaurora opened this issue 2 years ago • 3 comments

Versions

  • Python : 3.9.9
  • iOS version : any
  • XCode Version : any
  • Cython version : any
import ctypes

def functown(number: ctypes.c_int):
    print(number)

funcy = ctypes.CFUNCTYPE(None, ctypes.c_int)(functown)

This leads to a MemoryError everytime on iOS(Physical Device), only rarely on desktops/emulator. Issue is exactly as mentioned here https://bugs.python.org/issue36880

Since this is a known issue we should add it to the patches for python3 on kivy-ios.

Fix as mentioned on the issue.... https://github.com/python/cpython/pull/13364/files

akshayaurora avatar May 13 '22 09:05 akshayaurora

Upon further investigation including the mentioned patch does not help in fixing the issue :/ .

akshayaurora avatar May 13 '22 13:05 akshayaurora

Solution for me was simply to go the cython route. Keeping issue open as it's still relevant and others might come across same issue.

akshayaurora avatar Feb 08 '23 09:02 akshayaurora

Yes, I got this problem. image image image

dvjdjvu avatar Mar 22 '23 13:03 dvjdjvu