[Pythonmac-SIG] Python bindings for DB XML

Chris Barker Chris.Barker at noaa.gov
Mon Jan 26 14:27:36 EST 2004



Bob Ippolito wrote:
> On Jan 26, 2004, at 12:17 PM, Chris Barker wrote:
>>    #!/usr/bin/env pythonX.X
>>
>> At the top of your file. Where X.X is the version of Python you want 
>> (python2.2, python2.3, etc.)

> I agree with you, to a small extent, but this pythonX.X business that 
> you propose only matters to OS X 10.2 users.  On 10.2, any way you slice 
> it, /usr/local/bin isn't in the default path anyways

In theory, /usr/local/bin will never have vendor installed software, but 
I'm not so sure that I ALWAYS want a "local" version of a given program 
to be the default.

> (if I remember 
> correctly), so the PATH thing is generally reasonable (especially 
> because Apple didn't use Python at all on 10.2.x).

I'm really looking to the future here. no python version less than 10.2 
has ever been an issue on OS-X. IF you look at the Redhat story, 
however, they built some tools on Python 1.5, and saw no reason to 
upgrade for quite few years (until RedHat 8, with Python2.2). If RedHat 
had just had the brains to put #!/usr/bin/python1.5 in their files there 
never would have been a problem. Instead, all of us RedHat users have to 
do it, which I think we should anyway.

Apple may very well decide to keep using Python 2.3 when Python 3.5 is 
out. We have no way of predicting that, and we should not count on them 
doing anything in particular.

> In any case, there's one tiny little problem with what you propose: It 
> doesn't do a damn thing for 10.3 users.

It might when 2.4 (or whatever) comes out.

>     - can't accommodate for minor versions (f.ex Apple Python 2.3.0 and 
> your own Python 2.3.3)

I suppose you could put python2.3.3 on your #! line. In theory, this 
shouldn't be neccesary, as minor versions are supposed to be 
compataible. If only Apple would eiother upgrade Pythonl, or rrelease 
the source to their extensions so we could upgrade it (they haven't doen 
that have they?)

I would argue that Apple should do what RedHat should have done: put an 
explicit path to the python they want in their scripts that use python, 
including a minor version number. As they distribute both the python 
version and all the scripts that use it, they could do that, and it 
would solve a whole slew of problems. Of course, we have no control over 
what apple does so we'll just have to live with what they come up with. 
I don't have 10.3 installed yet...what do they put in theie #! lines?

>     - can't accommodate build parameters debug build vs normal build

I'd say don't put a debug build on your path at all...you should only 
use that if you know you want it, i.e. use an explicit path

>     - can't accommodate "distribution mechanism" (fink vs vendor vs user 
> Python)

This can be accomidated with an explicit path as well. As I think about 
it, perhaps OS-X is uniform enough that you could just use explicit 
paths all the time. On Linux, all the distros (and individual 
installations) are different enough that you're much better off using:

#!/usr/bin/env, and letting the system find the executable for you.

That may not be the case on OS-X

> People who are getting version mismatch problems are on 10.3, not 10.2. 
> If you compiled an extension with Apple Python 2.2.0 on OS X 10.2, 
> there's almost no way that you could accidentally load it from Python 
> 2.3.x, and vice versa.  That is certainly not true if you have a user 
> installation of Python on OS X 10.3.

This entangling of different 2.3 pythons is way beyond me to comprehend. 
There really should be a way to get the right libraries once you get the 
right executable. It's certainly beyond the users realm to figure this 
out for each python program written. I don't think this is a problem on 
Linux, but then I'm not sure I've ever tried it either.

Bob, do you have any other suggestions?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the Pythonmac-SIG mailing list