Alex's approach
Alex's approach
Posted Jun 28, 2024 15:43 UTC (Fri) by mb (subscriber, #50428)In reply to: Alex's approach by NYKevin
Parent article: Python grapples with Apple App Store rejections
That's Ok. They decided to play by the rules of Apple. So they should carry the workaround for Apple's stupid decisions.
Why should Python care?
>Apple doesn't want it there? Fine
Yes. It's fine. It's their decision and their problem.
>Fine, it's gone. Good riddance.
Do you realize that this is not a fix of the actual problem?
Apple will append something else to the list of forbidden words tomorrow.
Why should we let Apple indirectly make stupid decisions for an independent Open Source project?
Posted Jun 28, 2024 18:53 UTC (Fri)
by NYKevin (subscriber, #129325)
[Link]
The question is not why Python should care about iDevices. The question is why Python should care about the Apple ecosystem at all. itms-services is not a standard protocol. It appears in no RFC (that I've ever heard of). It is purely an Apple thing. And now it is causing problems, that were also created by Apple.
Why should Python even waste time thinking about any of this? Just yeet the whole thing out of urllib, and Apple developers who want to use this protocol for whatever reason can take a PyPI dependency.
But you don't even need a PyPI dependency, because urllib already DTRT on protocols it does not understand:
The string itms-services only appears in a list that tells the parser that it "uses netloc" (i.e. it should have a netloc part after the scheme, unlike say file://). As you can see above, it will happily parse nonsense schemes with netloc even if they are absent from said list. So at most, this might get you stricter checking in a few corners of the API, but it is probably not a showstopper.
Alex's approach
>>> urllib.parse.urlsplit('nonsense://www.example.com:80/foo/bar')
SplitResult(scheme='nonsense', netloc='www.example.com:80', path='/foo/bar', query='', fragment='')