harlowja / fasteners

A python package that provides useful locks.
Apache License 2.0
243 stars 45 forks source link

Could not find module 'kernel32' error on Xbox One when importing fasteners #103

Open watchedsyncforkodi opened 1 year ago

watchedsyncforkodi commented 1 year ago

I'm the author of a Kodi add-on module that imports the fasteners module.

A user has reported an issue on a Xbox One device which is raising an exception during the importing of fasteners module

https://paste.kodi.tv/goboseferu

Exception below:

EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- Error Type: <class 'FileNotFoundError'> Error Contents: Could not find module 'kernel32' (or one of its dependencies). Try using the full path with constructor syntax. Traceback (most recent call last): File "U:\Users\UserMgr0\AppData\Local\Packages\35635Vappy13.JXVNSMIZNWDEOOBU_tk60a0wpvtnzp\LocalState\addons\service.watchedsync\service.py", line 20, in <module> import fasteners File "U:\Users\UserMgr0\AppData\Local\Packages\35635Vappy13.JXVNSMIZNWDEOOBU_tk60a0wpvtnzp\LocalState\addons\service.watchedsync\resources\lib\fasteners\__init__.py", line 28, in <module> from fasteners.process_lock import interprocess_locked File "U:\Users\UserMgr0\AppData\Local\Packages\35635Vappy13.JXVNSMIZNWDEOOBU_tk60a0wpvtnzp\LocalState\addons\service.watchedsync\resources\lib\fasteners\process_lock.py", line 513, in <module> import fasteners.pywin32.pywintypes as pywintypes File "U:\Users\UserMgr0\AppData\Local\Packages\35635Vappy13.JXVNSMIZNWDEOOBU_tk60a0wpvtnzp\LocalState\addons\service.watchedsync\resources\lib\fasteners\pywin32\pywintypes.py", line 1, in <module> from ctypes import c_void_p File "S:\Program Files\WindowsApps\35635Vappy13.JXVNSMIZNWDEOOBU_19.4.0.70_x64__tk60a0wpvtnzp\system\python\lib\ctypes\__init__.py", line 468, in <module> GetLastError = windll.kernel32.GetLastError File "S:\Program Files\WindowsApps\35635Vappy13.JXVNSMIZNWDEOOBU_19.4.0.70_x64__tk60a0wpvtnzp\system\python\lib\ctypes\__init__.py", line 443, in __getattr__ dll = self._dlltype(name) File "S:\Program Files\WindowsApps\35635Vappy13.JXVNSMIZNWDEOOBU_19.4.0.70_x64__tk60a0wpvtnzp\system\python\lib\ctypes\__init__.py", line 373, in __init__ self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'kernel32' (or one of its dependencies). Try using the full path with constructor syntax. -->End of Python script error report<--

Have you seen this error before on Windows/Xbox before?

psarka commented 1 year ago

This is tricky, maybe some more configuration is needed for ctypes. I'll try to ask in the python discussion forum, and I don't have access to xbox one, which will complicate things a bit :)