[Pythonmac-SIG] Re: Extension module binary compatibility

Bob Ippolito bob@redivi.com
Thu, 20 Feb 2003 18:35:04 -0500


On Thursday, Feb 20, 2003, at 18:15 America/New_York, John Ehresman 
wrote:

> On Thu, 2003-02-20 at 17:48, Bob Ippolito wrote:
>> As I said, leave any other binary distribution of python modules to 
>> the
>> maintainers of the distribution... but if you MUST, you can do
>> something like this:
>> ...
>
> The name osx_framework can be changed, but what I'm looking for is a 
> way
> to determine if a framework is used and what it's name is that doesn't
> depend on pathname conventions.  Otherwise, it breaks when a no
> framework build is put in /home/username/i-like-weird-names.framework
> Admittedly this is a contrived example, but why not make the framework
> the executable was compiled with available in the executable?

In the not too distant future (Python 2.3), everyone on OS X will be 
using a framework python and/or Apple's jaguar python 2.2.  Hopefully 
Apple will go along with Python 2.3 when it comes out, because they 
aren't using Python 2.2 for anything as far as I can tell..  not as 
much as say, Perl 5.6, which happens in scripts, .pkg scripts, 
mod_perl, and probably other places internally.  osx_framework 
shouldn't be necessary, and should be considered a non-issue for 
anything but the near term.

In any case, whoever renames Python.framework to something else is 
doing something terrible (almost as bad as replacing 
/usr/bin/anything).. In any case, you'd have to try really hard to do 
that *and* have it still work.  Assuming Python.framework is in 
sys.path is very reasonable and shouldn't have any ill consequence..  
The only possible scenario I can think of is if someone decided to 
build a non-framework python and stick it in a subtree with 
Python.framework in the name.  Some of this could be avoided if you do 
if 'Python.framework' in sys.prefix.split('/') -- but it'd be an 
extremely rare case where someone would put a non-framewrok python in 
/somewhere/asdfPython.frameworkasdf/ or 
/somewhere/Python.framework/usr/lib or what have you.  It just won't 
happen 99.99999% of the time, you'd have to know what you're doing to 
cause that, and if you know what you're doing you won't do that :)

-bob