Ticket #22278 (closed defect: fixed)
python2.4 mac_ver reports incorrect version
| Reported by: | wichert@… | Owned by: | roel@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 1.8.1 |
| Keywords: | Cc: | grahamperrin@…, macsforever2000@…, ryandesign@… | |
| Port: | python24 |
Description
On python 2.4 the version information is missing:
Python 2.4.6 (#1, Oct 28 2009, 13:08:10)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.mac_ver()
('', ('', '', ''), '')
Python 2.6 gets it correct:
python2.6
Python 2.6.2 (r262:71600, Oct 7 2009, 14:08:41)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.mac_ver()
('10.6.1', ('', '', ''), 'i386')
this breaks setuptools since it can no longer match the architecture of the current system with the architecture of an egg and will refuse to install them.
Attachments
Change History
comment:2 Changed 4 years ago by blb@…
I'm surprised python24 even builds on 10.6, let alone works right; what do you need 2.4 for, as whatever it is should be moved to 2.6?
comment:3 Changed 4 years ago by wichert@…
Plons still requires python 2.4. There is a python 2.4 buildout in the collective on svn.plone.org which works correctly on 10.6, so this is certainly doable.
comment:4 Changed 4 years ago by jmr@…
2.5 gets it wrong too:
Python 2.5.4 (r254:67916, Oct 12 2009, 05:38:57)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.mac_ver()
('4294967306.4294967302.4294967297', ('', '', ''), '')
This is pretty clearly an upstream issue. The Mac code simply wasn't 64-bit compatible until 2.6, our backports of some patches to get 2.5 sort-of working notwithstanding.
comment:5 Changed 4 years ago by wichert@…
This patch from the python buildout on svn.plone.org might do the trick. In addition to that patch that buildout does two things: set CFLAGS=-arch x86_64 and make sure MACOSX_DEPLOYMENT_TARGET=10.6, both of which macports already does iirc.
comment:8 Changed 3 years ago by roel@…
The modules gestalt and MacOS aren't included. It fails in platform.py and returns the defaults
try:
import gestalt
import MacOS
except ImportError:
return release,versioninfo,machine
comment:9 Changed 3 years ago by roel@…
Attached is a fix for SL. It is based on the patch Wichert sent in.
comment:10 Changed 3 years ago by roel@…
The above patch is tested on Leopard and Snow Leopard, and works.
Can someone commit this?
comment:11 Changed 3 years ago by roel@…
Added diff based on latest svn version (Portfile.diff). The three patches should go in the files directory.
Could someone commit this?
comment:12 Changed 3 years ago by macsforever2000@…
- Status changed from new to closed
- Resolution set to fixed
comment:13 Changed 3 years ago by ryandesign@…
- Cc macsforever2000@…, ryandesign@… added
Shouldn't the portfile's revision also be incremented?
comment:14 Changed 3 years ago by macsforever2000@…
Done in r70279.

