If you compile Python under kernel 3.0, sys.platform changes to 'linux3'. The altered platform string introduces bugs in several libraries and in our softwares stack, too. We and a lot of other people check for Linux with sys.platform == "linux2".
>>> import sysIt turns out the 'configure' script causes the problem. It takes the lower case kernel name (uname -s) and first digit of the kernel release (uname -r) to fill the variable MACHDEP. The issue is discussed in http://bugs.python.org/issue12326 to a create length and addressed in upcoming releases 2.7.3, 3.2.2 and 3.3. The 2.7 and 3.2 series announce a 3.0 Linux kernel as linux2 platform. Starting with Python 3.3 sys.platform will be 'linux' for Kernel 2.x and 3.x.
>>> sys.platform
'linux3'
However 2.7.3 isn't out yet. Worse older versions of Python are in maintenance mode and will only see security fixes. I'm going to show you, how you can work around the issue.
Change your software
I recommend that you replace all code like sys.platform == "linux2" with sys.platform.startswith("linux"). It causes the least trouble and is future compatible with Python 3.3 as well.
Alter the configure script
If you compile your own version of Python on Linux, you can alter the configure script before running it.
case $MACHDEP in
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
atheos*) MACHDEP="atheos";;
irix646) MACHDEP="irix6";;
linux*) MACHDEP="linux2";; # add this line
'') MACHDEP="unknown";;
esac
Run make with MACHDEP=linux2
I find it easier to run make a different MACHDEP variable. It requires no patching.
./configureGood luck!
make MACHDEP=linux2
make altinstall