Issue 1203: ctypes doesn't work on Mac with --disable-toolbox-glue (original) (raw)

Created on 2007-09-25 16:29 by janssen, last changed 2022-04-11 14:56 by admin. 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
2022-04-11 14:56:27 admin set github: 45544
2007-10-11 19:52:06 theller set status: open -> closedassignee: thellermessages: + resolution: accepted
2007-10-02 16🔞59 janssen set messages: +
2007-09-25 19:16:12 theller set files: + osx.patchmessages: +
2007-09-25 17:30:48 janssen set files: - p
2007-09-25 17:30:38 janssen set files: + pmessages: +
2007-09-25 17:02:08 theller set messages: +
2007-09-25 16:54:35 janssen set files: + pmessages: +
2007-09-25 16:49:54 theller set nosy: + thellermessages: +
2007-09-25 16:29:23 janssen create