Python system paths initialization on Xbox
Following https://github.com/anxdpanic/plugin.video.youtube/issues/923, I report a failure regarding Python paths initialization on Xbox.
Could you please test script.module.inputstreamhelper-0.7.0-master-a672b6e.zip
I've still got path issues.
2024-10-13 19:13:13.381 T:4656 error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
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 "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\plugin.video.rtsplaytv\addon.py", line 20, in <module>
from resources.lib import rtsplaytv
File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\plugin.video.rtsplaytv\resources\lib\rtsplaytv.py", line 31, in <module>
import srgssr
File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.srgssr\lib\srgssr.py", line 39, in <module>
import inputstreamhelper
File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.inputstreamhelper\lib\inputstreamhelper\__init__.py", line 14, in <module>
from .widevine.arm import dl_extract_widevine_chromeos, extract_widevine_chromeos, install_widevine_arm
File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.inputstreamhelper\lib\inputstreamhelper\widevine\arm.py", line 13, in <module>
from .arm_lacros import cdm_from_lacros, install_widevine_arm_lacros
File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.inputstreamhelper\lib\inputstreamhelper\widevine\arm_lacros.py", line 17, in <module>
from ..unsquash import SquashFs
File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.inputstreamhelper\lib\inputstreamhelper\unsquash.py", line 19, in <module>
from ctypes import CDLL, c_void_p, c_size_t, create_string_buffer
File "S:\Program Files\WindowsApps\XBMCFoundation.Kodi_21.1.0.70_x64__4n2hpmxwrvr6p\system\python\Lib\ctypes\__init__.py", line 468, in <module>
GetLastError = windll.kernel32.GetLastError
File "S:\Program Files\WindowsApps\XBMCFoundation.Kodi_21.1.0.70_x64__4n2hpmxwrvr6p\system\python\Lib\ctypes\__init__.py", line 443, in __getattr__
dll = self._dlltype(name)
File "S:\Program Files\WindowsApps\XBMCFoundation.Kodi_21.1.0.70_x64__4n2hpmxwrvr6p\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<--
As @MoojMidge pointed out, this seems to affect all addons using python.
this seems to affect all addons using python.
Only on some subset of Windows platforms, where presumably access to system file paths are limited due to sandboxing. Possibly related to this change in CPython https://github.com/python/cpython/commit/2438cdf0e932a341c7613bf4323d06b91ae9f1f1#diff-edff4421a88bdc56335a84a1e5a0ce0eafe5cd0c37dcb1aff03ff075bfb9b57c
It is more of a Kodi issue, but I suggested opening an issue here so that the decision to try to load the LaCrOS browser image could be managed a little better by changing
https://github.com/emilsvennesson/script.module.inputstreamhelper/blob/06b88d3984bad45472246321bd476dbc86c027e0/lib/inputstreamhelper/widevine/arm.py#L13
to the following:
try:
from .arm_lacros import cdm_from_lacros, install_widevine_arm_lacros
except (ImportError, OSError):
cdm_from_lacross = install_widevine_arm_lacros = None
and then changing https://github.com/emilsvennesson/script.module.inputstreamhelper/blob/06b88d3984bad45472246321bd476dbc86c027e0/lib/inputstreamhelper/widevine/arm.py#L156-L157
to the following:
if cdm_from_lacros and cdm_from_lacros():
return install_widevine_arm_lacros(backup_path)
Any news on this?
0.5.1 still needed to get inputstream helper working on xbox
@rampagejoe Have you tested #582? I don't have an Xbox to try with right now, but I can merge the PR and cut a new release if it works.
@rampagejoe Have you tested #582? I don't have an Xbox to try with right now, but I can merge the PR and cut a new release if it works.
@emilsvennesson I tried the updated zip and the manual lacros changes to arm.py
Both solutions didn't work for me
Dunno much about this topic yet
All I know is that it seems like omega killed a lot of addons on xbox because of python problems... Related to wrong paths?
Some python based addons still work though...
I also tried macos/android/windows store version & installer version for comparison No problems with any addons
Dunno if it matters for addons at all But I got xbox dev access to test fixes, updates etc
The problem is this line
script.module.inputstreamhelper\lib\inputstreamhelper\unsquash.py"
from ctypes import CDLL, c_void_p, c_size_t, create_string_buffer
FileNotFoundError: Could not find module 'kernel32' (or one of its dependencies).
The UWP version of Kodi that runs on XBOX cannot handle ctypes library or the crypto library as it is incorrectly built as an Windows DESKTOP app. so kernel32.dll which ctype and crypto expect on a DESKTOP app is actually not available in UWP environment. Kodi itself needs to be built correctly for this. Been sitting in their git issues for a while now https://github.com/xbmc/xbmc/issues/24746