Python 2.5 does not build correctly out of the box on Mac OS X 10.6. (It does build OK as is on 10.5 or 10.4, though.) There is at least one configure fix that needs to be backported from later Pythons. And you need to use gcc-4.0, not -4.2. Once you have extracted the source:
cd ./Python-2.5.5/
cat >patch-configure-for-10-6.patch <<EOF
--- configure.O 2008-12-13 06:13:52.000000000 -0800
+++ configure 2010-09-29 10:16:05.000000000 -0700
@@ -2039,7 +2039,11 @@
# disables platform specific features beyond repair.
# On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
# has no effect, don't bother defining them
- FreeBSD/4.* | Darwin/[6789].*)
+ FreeBSD/4.*)
+ define_xopen_source=no;;
+ Darwin/[6789].*)
+ define_xopen_source=no;;
+ Darwin/1[0-9].*)
define_xopen_source=no;;
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
EOF
patch < patch-configure-for-10-6.patch
export CC=/usr/bin/gcc-4.0
./configure --prefix=/usr/local --enable-framework MACOSX_DEPLOYMENT_TARGET=10.6
make
sudo make install
Then there are various less obvious build issues like third-party libraries that are needed for all of the standard library modules to build and work as expected - GNU readline and bsddb come to mind - so there is no guarantee that you won't run into other problems.
$ python2.5
Python 2.5.5 (r255:77872, Sep 29 2010, 10:23:54)
[GCC 4.0.1 (Apple Inc. build 5494)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Module readline not available.
>>>
You could try using the installer build script in the source tree (in Mac/BuildScript/
) but it will likely need to be patched to work correctly on 10.6.
Even though there is no official python.org installer for 2.5.5 (which just has security fixes), there is an OS X installer for 2.5.4 which works fine on 10.6. Or use the Apple-supplied 2.5.4. Or try MacPorts. It will be nice when GAE is supported on current Python versions.