script.module addons - zachmorris - 2018-05-01
I'm attempting to test my addon with the test versions of Kodi with python 3. Ran into an issue because my addon currently uses script.module.requests.
The test version of Kodi crashes on the import call:
python:
try:
import requests
except:
xbmc.log(msg='script.module.requests is not installed and is required', level=xbmc.LOGERROR)
Nothing in the logs at the crash point. Are the current script.module.* addons expected to work with python 3, or would a completely seperate installation be required with different script.module.* addons?
RE: script.module addons - Roman_V_M - 2018-05-01
Module addons, representing mainstream Python libraries, like requests, are usually compatible with both Python 2 and 3. And you should really avoid blanket except: statements so that you could receive meaningful error messages.
RE: script.module addons - zachmorris - 2018-05-01
I tried it both ways (with and without an except). It crashes Kodi both ways with no meaningful error message.
RE: script.module addons - Rechi - 2018-05-01
I tried to import requests and do a simple request. Everything worked fine (Windows, 20180425-dfb6a5b0-feature_python3-x64).
Can you give more details about your setup or better share the debug log.
RE: script.module addons - zachmorris - 2018-05-01
Using:
kodi-20180425-dfb6a5b0-feature_python3-x86_64.dmg
Log:
xml: 09:40:11.793 T:140735159148544 NOTICE: special://profile/ is mapped to: special://masterprofile/
09:40:11.793 T:140735159148544 NOTICE: -----------------------------------------------------------------------
09:40:11.793 T:140735159148544 NOTICE: Starting Kodi (18.0-ALPHA2 Git:20180425-dfb6a5b067). Platform: OS X x86 64-bit
09:40:11.793 T:140735159148544 NOTICE: Using Debug Kodi x64 build
09:40:11.793 T:140735159148544 NOTICE: Kodi compiled Apr 25 2018 by Clang 9.0.0 (clang-900.0.37) for OS X x86 64-bit version 10.8.0 (1080)
09:40:11.794 T:140735159148544 NOTICE: Running on Apple Inc. MacBookPro12,1 with OS X 10.11.6, kernel: Darwin x86 64-bit version 15.6.0
09:40:11.794 T:140735159148544 NOTICE: FFmpeg version/source: 4.0-Kodi
09:40:11.794 T:140735159148544 NOTICE: Host CPU: Intel® Core i5-5257U CPU @ 2.70GHz, 4 cores available
09:40:11.794 T:140735159148544 NOTICE: special://xbmc/ is mapped to: /Applications/Kodi_Py3.app/Contents/Resources/Kodi
09:40:11.794 T:140735159148544 NOTICE: special://xbmcbin/ is mapped to: /Applications/Kodi_Py3.app/Contents/Resources/Kodi
09:40:11.794 T:140735159148544 NOTICE: special://xbmcbinaddons/ is mapped to: /Applications/Kodi_Py3.app/Contents/Resources/Kodi/addons
09:40:11.794 T:140735159148544 NOTICE: special://masterprofile/ is mapped to: /Users/XXX/Library/Application Support/Kodi/userdata
09:40:11.794 T:140735159148544 NOTICE: special://envhome/ is mapped to: /Users/XXX
09:40:11.794 T:140735159148544 NOTICE: special://home/ is mapped to: /Users/XXX/Library/Application Support/Kodi
09:40:11.794 T:140735159148544 NOTICE: special://temp/ is mapped to: /Users/XXX/.kodi/temp
09:40:11.794 T:140735159148544 NOTICE: special://logpath/ is mapped to: /Users/XXX/Library/Logs
09:40:11.794 T:140735159148544 NOTICE: special://frameworks/ is mapped to: /Applications/Kodi_Py3.app/Contents/Libraries
09:40:11.795 T:140735159148544 NOTICE: The executable running is: /Applications/Kodi_Py3.app/Contents/MacOS/Kodi
09:40:11.795 T:140735159148544 NOTICE: Local hostname: Zs-MacBook-Pro.lan
09:40:11.795 T:140735159148544 NOTICE: Log File is located: /Users/XXX/Library/Logs//kodi.log
09:40:11.795 T:140735159148544 NOTICE: -----------------------------------------------------------------------
...
09:40:11.882 T:140735159148544 NOTICE: ADDON: script.module.requests v2.18.4.1 installed
...
09:40:11.884 T:140735159148544 NOTICE: ADDON: xbmc.python v2.25.0 installed
...
Test Code:
python: print('my test')
import requests
print('my test 2')
Crash Log (empty after print statement):
xml: 09:43:04.228 T:123145309356032 DEBUG: my test
I could provide the OSX crash report as well if needed, but the issue seems repeatable if it's unexpected with the currently released script.module.requests
|