This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: platform.mac_ver() returning incorrect patch version
Type: Stage:
Components: macOS Versions: Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: gtabares, jackjansen, ronaldoussoren
Priority: normal Keywords: patch

Created on 2007-08-08 18:08 by gtabares, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mac-platform.patch ronaldoussoren, 2008-05-02 22:20
Messages (4)
msg32600 - (view) Author: Gus Tabares (gtabares) Date: 2007-08-08 18:08
Running on an Intel Mac OSX 10.4.10 machine:

>>> platform.mac_ver()
('10.4.9', ('', '', ''), 'i386')


I have reproduced this on 4 other (Intel Mac) machines. I don't have access to a 10.4.10 PPC machine.



msg32601 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2007-08-08 22:05
Interesting problem! Mac_ver() basically uses gestalt() with a selector of 'sysv' and this will return '9' for the micro-version if it is 9 or greater.
It could be fixed, according to <http://www.adobeforums.com/cgi-bin/webx?14@@.3bc49a09/0> by using three calls to gestalt() with selectors 'sys1', 'sys2' and 'sys3', which will return the three numbers correctly.

I'm not sure whether these selectors are always available, will investigate.
msg66124 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2008-05-02 22:20
See also http://www.cocoabuilder.com/archive/message/cocoa/2006/11/18/174677

The attached patch should fix this issue.

Jack, could you please check if the patch is sane? The patch works on 
10.5.2, I haven't checked on 10.4 yet (I'll have to reboot to do that)
msg66413 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2008-05-08 10:35
I've tested the patch on 10.4.10 as wel as 10.5.2 and it returns the right 
version on both platforms.

Commited as revision 62854 (trunk) and 62855 (python2.5 branch)
History
Date User Action Args
2022-04-11 14:56:25adminsetgithub: 45289
2008-05-08 10:36:06ronaldoussorensetstatus: open -> closed
assignee: jackjansen -> ronaldoussoren
resolution: fixed
messages: + msg66413
2008-05-02 22:20:37ronaldoussorensetfiles: + mac-platform.patch
nosy: + ronaldoussoren
messages: + msg66124
keywords: + patch
versions: + Python 2.6
2007-08-08 18:08:55gtabarescreate