Skip to content

Instantly share code, notes, and snippets.

@4ft35t
Last active May 12, 2018 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4ft35t/7d76584cfc847926065e21b08ffc16e3 to your computer and use it in GitHub Desktop.
Save 4ft35t/7d76584cfc847926065e21b08ffc16e3 to your computer and use it in GitHub Desktop.
kodi 17.6 python bug

addon.py

def log(msg):
    print('[test] %s' % msg)

data = {'key1':1, 'key': 2}
try:
    assert 'key3' in data, 'no key'
except Exception as e:
    log(str(e))
else:
    log('ok')
finally:
    log('end')

general output

plugin.video.test python2 addon.py
[test] no key
[test] end
➜  plugin.video.test python3 addon.py
[test] no key
[test] end

kodi output, test OSX and Android 32bit

00:49:58.893 T:123145376911360   DEBUG: [test] ok
00:49:58.893 T:123145376911360   DEBUG: [test] end

WHY?

https://forum.kodi.tv/showthread.php?tid=291013&pid=2421968#pid2421968

We set PYTHONOPTIMIZE=1 when loading the interpreter on most platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment