Author lemburg
Recipients Arfrever, Ramchandra Apte, amaury.forgeotdarc, barry, djc, dmalcolm, doko, ezio.melotti, foom, gagern, haypo, jwilk, lemburg, loewis, merwok, petri.lehtinen, pitrou, python-dev, r.david.murray, rosslagerwall, sandro.tosi
Date 2011-08-19.09:09:39
SpamBayes Score 0.0
Marked as misclassified No
Message-id <4E4E284B.7060504@egenix.com>
In-reply-to <4E4E1B51.3040602@gmx.net>
Content
Martin von Gagern wrote:
> 
> Martin von Gagern <Martin.vGagern@gmx.net> added the comment:
> 
> Marc-Andre Lemburg wrote:
>> Both Python and the application will make certain assumptions about
>> the platform depending on the compile time environment.
> 
> Can you give examples for this?

Sure, just have a look at how different the various minor release
Mac OS X versions are. They even changed the default architecture
without bumping the major version of the OS.

A configure run on one OS version will pick up different
environment settings than on a later one. As a result Python
and application extensions use different libs/packages/tools
or even create completely different runtimes (e.g. one for PPC,
the other for i386).

>> So you need both the compile and the runtime version information.
> 
> I very much doubt that any feature in Python is actually enabled if
> compiled under Linux 3. If so that's probably a bug in Python, due to
> the small number of features added from 2.6.39 to 3.0. Either the
> feature was introduced into Linux before 3.0, in which case Python
> should use it as early as possible, or the feature was introduced in
> some 3.x release, in which case not all Linux 3 builds will have it.
> 
> So the single digit major number will not be enough for this kind of
> checks, and the safest way is to check for the feature itself, e.g. by
> simply using it and handling NotImplementedException appropriately. That
> approach is more portable for new platforms as well.

That works fine for features that you can programmatically
control. It doesn't work well for static data that you provide
externally depending on the platform OS version. Take e.g.
the plat-freebsdN directories with the OS dependent
constants/functions as example.

As already mentioned, the diff between Linux 2.x and 3.x will
grow over time and while there may not be much to see now,
things will change in the coming years.

Just look at the differences between plat-linux1 and plat-linux2
(plat-linux1 was phased out in Python 2.4 so you have to go back
to Python 2.3 or earlier).
History
Date User Action Args
2011-08-19 09:09:41lemburgsetrecipients: + lemburg, loewis, barry, doko, amaury.forgeotdarc, gagern, foom, pitrou, haypo, jwilk, djc, ezio.melotti, merwok, Arfrever, r.david.murray, dmalcolm, sandro.tosi, rosslagerwall, python-dev, petri.lehtinen, Ramchandra Apte
2011-08-19 09:09:40lemburglinkissue12326 messages
2011-08-19 09:09:39lemburgcreate