platform.system() breaks scripts on iOS
#1
I've seen a few scripts that work on other platforms break on iOS because they use platform.system() eg line 439 here https://pastebin.com/3FNFUbab

I've read the iOS implementation of python doesn't allow spawning of child processes, which causes this error.
Reply
#2
Yes that is correct as of tvos 10 and ios 11 iirc.
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
I generated the error with iOS 10.2 (iPhone 6S, iPad Air 2), for some reason I'm not getting the error on tvOS 11.1 (ATV4 - non4k).

Seems like it might be a bug, or perhaps kodi for iOS isn't built for iOS >=10?
Reply
#4
I'm not certain this is a bug, although it seems to be a bug to me as it is limited to iOS >= 10 and not encountered in tvOS >= 10. Would anyone be able to advise and ill submit a bug tracker ticket if necessary?

Thanks in advance!
Reply
#5
I have no idea what you mean - its forbidden in iOS and tvOS - that's a fact. What do you expect from kodi in that regard?
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
#6
That kodi not attempt to do so when calling platform.system() on iOS?

Sorry if that's an oversimplification of what's going on but the same script that runs fine without breaking on tvOS 11 breaks on iOS 10 when a call to platform.system() is made.

I assume that under tvOS 11 python isn't attempting to spawn any child processes when platform.system() is called but for some reason python does attempt to spawn child processes when platform.system() is called under iOS 10. Would that be correct?
Reply
#7
No - calling system is forbidden - and it will always spawn a new process - that's how "system" call works - compiler for iOS and tvOS bails out when calling it from c/c++ too - that's why I had to remove all traces of those calls from kodi core for iOS and tvOS - are you sure that the code does what it should ob tvOS? Or is the system call somehow just "eaten" without doing the actual work?
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
#8
I'll grab a debug log when I get back to my tvOS box.

Until then all I can be certain of is that certain things load properly and behave as expected on tvOS that fail on iOS while calling platform.system() .

The end behaviour is very different from iOS to tvOS wether it's being eaten or handled properly which is why I considered it might be a bug.

Would there be a reason that something would load properly on tvOS while it will fail to load on iOS that wouldn't be a bug or unexpected behaviour?
Reply
#9
The only thing that i can think of is that i have patched python for tvos in a stronger way then on ios. That might result in the fact that ios python throws an exception when „system“ is called and tvos silently ignores the call. If its anything else - then apple made the behavior inconsistent between tvos and ios.
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
platform.system() breaks scripts on iOS0