Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#22278 closed defect (fixed)

python2.4 mac_ver reports incorrect version

Reported by: wichert@… Owned by: jaroel (Roel Bruggink)
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: Cc: grahamperrin@…, mf2k (Frank Schima), ryandesign (Ryan Carsten Schmidt)
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 (5)

patch-macosmodule.diff (10.0 KB) - added by jaroel (Roel Bruggink) 14 years ago.
patch-mactoolboxglue.diff (733 bytes) - added by jaroel (Roel Bruggink) 14 years ago.
patch-pymactoolbox.diff (585 bytes) - added by jaroel (Roel Bruggink) 14 years ago.
Portfile.mac_ver.diff (301 bytes) - added by jaroel (Roel Bruggink) 14 years ago.
Portfile.diff (174 bytes) - added by jaroel (Roel Bruggink) 14 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Port: python24 added

comment:2 Changed 15 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 15 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 15 years ago by jmroot (Joshua Root)

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 15 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:6 Changed 14 years ago by grahamperrin@…

Cc: grahamperrin@… added

Cc Me!

comment:7 Changed 14 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to roel@…

comment:8 Changed 14 years ago by jaroel (Roel Bruggink)

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

Changed 14 years ago by jaroel (Roel Bruggink)

Attachment: patch-macosmodule.diff added

Changed 14 years ago by jaroel (Roel Bruggink)

Attachment: patch-mactoolboxglue.diff added

Changed 14 years ago by jaroel (Roel Bruggink)

Attachment: patch-pymactoolbox.diff added

comment:9 Changed 14 years ago by jaroel (Roel Bruggink)

Attached is a fix for SL. It is based on the patch Wichert sent in.

Changed 14 years ago by jaroel (Roel Bruggink)

Attachment: Portfile.mac_ver.diff added

comment:10 Changed 14 years ago by jaroel (Roel Bruggink)

The above patch is tested on Leopard and Snow Leopard, and works.

Can someone commit this?

Changed 14 years ago by jaroel (Roel Bruggink)

Attachment: Portfile.diff added

comment:11 Changed 14 years ago by jaroel (Roel Bruggink)

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 14 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: newclosed

comment:13 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: macsforever2000@… ryandesign@… added

Shouldn't the portfile's revision also be incremented?

comment:14 Changed 14 years ago by mf2k (Frank Schima)

Done in r70279.

Note: See TracTickets for help on using tickets.