[Python-bugs-list] [ python-Bugs-780461 ] MacOS.Error for platform.mac_ver under OS X

SourceForge.net noreply at sourceforge.net
Tue Oct 14 18:30:18 EDT 2003


Bugs item #780461, was opened at 2003-07-30 13:20
Message generated for change (Comment added) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=780461&group_id=5470

Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Brett Cannon (bcannon)
Assigned to: M.-A. Lemburg (lemburg)
Summary: MacOS.Error for platform.mac_ver under OS X

Initial Comment:
>>> platform.mac_ver()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/Users/drifty/cvs_code/lib/python2.3/platform.py", 
line 563, in mac_ver
    sysv,sysu,sysa = _mac_ver_lookup(('sysv','sysu','sysa'))
  File "/Users/drifty/cvs_code/lib/python2.3/platform.py", 
line 532, in _mac_ver_lookup
    append(gestalt(selector))
MacOS.Error: (-5551, 'undefined selector was passed to 
Gestalt')


This is on an OS X 10.2.6 system.

Any chance this is because I compiled with --enable-
unicode=ucs4 ?

----------------------------------------------------------------------

>Comment By: Brett Cannon (bcannon)
Date: 2003-10-14 15:30

Message:
Logged In: YES 
user_id=357491

Well, this is working for me under 2.4 (still busted under 2.3, 
though).  But a quick check of the cvs logs and it turns out Jack 
wanted this backported but just didn't get to it.

So I will go ahead and backport the changes from 1.6 and 1.7 to 
release23-maint.

----------------------------------------------------------------------

Comment By: Brett Cannon (bcannon)
Date: 2003-08-07 19:28

Message:
Logged In: YES 
user_id=357491

I have no clue how to get the info but I can help test anything.  I 
think Jack is going to have to be the big helper in terms of how to 
patch this one.

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2003-08-01 04:40

Message:
Logged In: YES 
user_id=38388

Catching MacOS.Error doesn't help much: if 'sysu' is not
available on MacOSX, then I need the system information 
from somewhere else. Any hints ? (don't have a MacOSX
to test on, so it's up to you to provide the necessary 
information or patch :-)

Thanks.

----------------------------------------------------------------------

Comment By: Jack Jansen (jackjansen)
Date: 2003-08-01 02:40

Message:
Logged In: YES 
user_id=45365

The problem is not with your ucs4 build, this call always fails 
under MacOSX. The problem is that the 'sysu' gestalt selector isn't 
available under OSX.

The code in _mac_ver_lookup does a try/except on RuntimeError 
around the call to gestalt, but I don't remember MacOS.Error ever 
being a subclass of RuntimeError. Currently MacOS.Error is in a 
class by itself, it should probably be an OSError subclass, but that 
still won't fix this.

I suggest doing the try/except on MacOS.Error.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=780461&group_id=5470



More information about the Python-bugs-list mailing list