New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #22278 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

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

patch-macosmodule.diff (10.0 KB) - added by roel@… 4 years ago.
patch-mactoolboxglue.diff (733 bytes) - added by roel@… 4 years ago.
patch-pymactoolbox.diff (585 bytes) - added by roel@… 4 years ago.
Portfile.mac_ver.diff (301 bytes) - added by roel@… 4 years ago.
Portfile.diff (174 bytes) - added by roel@… 4 years ago.

Change History

comment:1 Changed 4 years ago by macsforever2000@…

  • Port set to python24

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

  • Cc grahamperrin@… added

Cc Me!

comment:7 Changed 4 years ago by jmr@…

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

comment:8 Changed 4 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

Changed 4 years ago by roel@…

Changed 4 years ago by roel@…

Changed 4 years ago by roel@…

comment:9 Changed 4 years ago by roel@…

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

Changed 4 years ago by roel@…

comment:10 Changed 4 years ago by roel@…

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

Can someone commit this?

Changed 4 years ago by roel@…

comment:11 Changed 4 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 4 years ago by macsforever2000@…

  • Status changed from new to closed
  • Resolution set to fixed

comment:13 Changed 4 years ago by ryandesign@…

  • Cc macsforever2000@…, ryandesign@… added

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

comment:14 Changed 4 years ago by macsforever2000@…

Done in r70279.

Note: See TracTickets for help on using tickets.