Python Development & IOS
#1
I'm working on a python addon for XBMC. For some reason, the script terminates unexpectedly somewhere in a 'time' routine.

Unfortunately, the python interpreter is not handling errors as expected and is not giving any debug output.

The script runs fine under both Win and OSX. I'm not sure why the abended script is not producing an error and traceback under iOS as it does under Win or OSX.

While it is possible to debug without this info, it would be so much easier if the interpreter gave some helpful hint as to why it's crapping out.

Can someone please help?

Best,
guitardood

EDIT: Should have mentioned, this is on an iPad2 with IOS 5.1 and XBMC Frodo RC3
Reply
#2
Did you turn on debugging (system->system->debugging)? This might enable the python exception output.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#3
Regardless of the debug setting, the only message I get is 'plugin exited prematurely - terminating'. Even if I create a blatant syntax error in a simple 3 line python script, the interpreter in XBMC on iOS does not print any python errors, just the aforementioned 'terminating' message.

Any help with this would be greatly appreciated. I've created a really nifty plugin framework that has a lot of cool features but it will never be releasable if I can't properly debug.
Reply
#4
Can you try it on osx? It should printout the errors there...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#5
When I run the script on OSX, it does not terminate unexpectedly, only on iOS. I actually fixed my current problem by putting a ton of debug messages to narrow down where it was abending and fixed it. However, for future development, it would be really helpful if the python exception log on iOS could print to the xbmc.log file same as on OSX, Win & Linux.
Reply
#6
Is the script terminating or does XBMC actually crash? If an error/exception is raised in python that gets back into the xbmc c++ code then it should certainly print the stack trace.
Reply
#7
(2013-02-01, 00:50)jfcarroll Wrote: Is the script terminating or does XBMC actually crash? If an error/exception is raised in python that gets back into the xbmc c++ code then it should certainly print the stack trace.

If you specifically create a python script with a syntax error, the script just terminates without error and without any kind of debug info such as line number or module of error. XBMC does at least report that the script terminated abnormally, but no other info in the log file.

Example:

#!/usr/bin/python
print("This Line Works and shows up in the log file")
This line should be a syntax error but goes unreported and script just dies.
print("This line never gets executed")

Makes it very difficult to debug a multi-module script when you have no idea where the script is stopping or why and only seems to be on the iOS versions.

Best,
guitardood
Reply
#8
Bump.
Reply
#9
Bumpity bump!

Anyone?

I really don't mean to be jerky about this, but it is a huge problem trying to run scripts that crap out only on iOS and don't give error reports. The script runs fine on every other platform. It seems to be failing in a 'time' module routine (tracked down by putting a ton of prints to narrow down the call where the problem was occurring. Probably something that has an exception trap around it, but if the script bombs it should at the very least give a line number and module name where the script failed.

At the very least, could someone try the code I posted above and check your log to try and reproduce this? I'm experiencing this issue on iOS 5.1

Best,
guitardood
Reply
#10
We finally fixed that one ... - python exceptions will show up again in next nightly build.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Python Development & IOS0