classification
Title: ctypes doesn't work on Mac with --disable-toolbox-glue
Type: behavior Stage:
Components: Library (Lib), macOS Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: theller Nosy List: janssen, theller
Priority: normal Keywords:

Created on 2007-09-25 16:29 by janssen, last changed 2007-10-11 19:52 by theller. This issue is now closed.

Files
File name Uploaded Description Edit
p janssen, 2007-09-25 17:30
osx.patch theller, 2007-09-25 19:16
Messages (8)
msg56132 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2007-09-25 16:29
If you build Python with --disable-toolbox-glue on OS X, the attempt to 
import ctypes fails because it critically depends on "gestalt", one of 
the modules in the toolbox.  It only uses this to check whether the OS 
level is 10.4 or something earlier, and only once, at load.  Might be a 
good idea to substitute a check which doesn't require the toolbox, such 
as looking at platform.release().
msg56133 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2007-09-25 16:49
Would you like to prepare a patch?  I have no idea how the return values
of gestalt.gestalt("sysv") and platform.release() relate to each other...
msg56134 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2007-09-25 16:54
Here's a patch against the trunk.  I've only tried it on OS X 10.4.10, and 
only with test_ctypes.  Ideally, we should test on an earlier version of 
OS X, but I don't have one handy.
msg56135 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2007-09-25 17:02
On the mac where I have access to platform.release() returns the string
'8.10.0'.  gestalt.gestalt("sysv") returns 0x1049.  Your patch does not
look correct to me.
msg56137 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2007-09-25 17:30
Sorry, you're absolutely right.  Here's a corrected patch.
msg56139 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2007-09-25 19:16
This patch looks better.  However, the 'os.uname()' function seems to
return the information that we need; so I updated the patch to use this
instead.  Can you please proofread it (osx.patch) ?
msg56216 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2007-10-02 16:18
Yes, that works too.  It seems to be another way of accessing
the same information; it's not clear to me which is preferable.

Bill

On 9/25/07, Thomas Heller <report@bugs.python.org> wrote:
>
> Thomas Heller added the comment:
>
> This patch looks better.  However, the 'os.uname()' function seems to
> return the information that we need; so I updated the patch to use this
> instead.  Can you please proofread it (osx.patch) ?
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1203>
> __________________________________
>
msg56349 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2007-10-11 19:52
IMO os.uname() is preferable.
Committed as SVN rev 58415 in trunk.
Thanks.
History
Date User Action Args
2007-10-11 19:52:06thellersetstatus: open -> closed
assignee: theller
messages: + msg56349
resolution: accepted
2007-10-02 16:18:59janssensetmessages: + msg56216
2007-09-25 19:16:12thellersetfiles: + osx.patch
messages: + msg56139
2007-09-25 17:30:48janssensetfiles: - p
2007-09-25 17:30:38janssensetfiles: + p
messages: + msg56137
2007-09-25 17:02:08thellersetmessages: + msg56135
2007-09-25 16:54:35janssensetfiles: + p
messages: + msg56134
2007-09-25 16:49:54thellersetnosy: + theller
messages: + msg56133
2007-09-25 16:29:23janssencreate