kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
759 stars 238 forks source link

Ctypes.CFUNCTYPE needs patching for iOS #708

Open akshayaurora opened 2 years ago

akshayaurora commented 2 years ago

Versions

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 commented 2 years ago

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

akshayaurora commented 1 year ago

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.

dvjdjvu commented 1 year ago

Yes, I got this problem. image image image