Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctypes doesn't work on Mac with --disable-toolbox-glue #45544

Closed
janssen mannequin opened this issue Sep 25, 2007 · 8 comments
Closed

ctypes doesn't work on Mac with --disable-toolbox-glue #45544

janssen mannequin opened this issue Sep 25, 2007 · 8 comments
Assignees
Labels
OS-mac stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@janssen
Copy link
Mannequin

janssen mannequin commented Sep 25, 2007

BPO 1203
Nosy @theller
Files
  • p
  • osx.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/theller'
    closed_at = <Date 2007-10-11.19:52:06.040>
    created_at = <Date 2007-09-25.16:29:23.308>
    labels = ['OS-mac', 'type-bug', 'library']
    title = "ctypes doesn't work on Mac with --disable-toolbox-glue"
    updated_at = <Date 2007-10-11.19:52:06.038>
    user = 'https://bugs.python.org/janssen'

    bugs.python.org fields:

    activity = <Date 2007-10-11.19:52:06.038>
    actor = 'theller'
    assignee = 'theller'
    closed = True
    closed_date = <Date 2007-10-11.19:52:06.040>
    closer = 'theller'
    components = ['Library (Lib)', 'macOS']
    creation = <Date 2007-09-25.16:29:23.308>
    creator = 'janssen'
    dependencies = []
    files = ['8469', '8470']
    hgrepos = []
    issue_num = 1203
    keywords = []
    message_count = 8.0
    messages = ['56132', '56133', '56134', '56135', '56137', '56139', '56216', '56349']
    nosy_count = 2.0
    nosy_names = ['theller', 'janssen']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1203'
    versions = ['Python 2.6', 'Python 3.0']

    @janssen
    Copy link
    Mannequin Author

    janssen mannequin commented Sep 25, 2007

    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().

    @janssen janssen mannequin added stdlib Python modules in the Lib dir OS-mac type-bug An unexpected behavior, bug, or error labels Sep 25, 2007
    @theller
    Copy link

    theller commented Sep 25, 2007

    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...

    @janssen
    Copy link
    Mannequin Author

    janssen mannequin commented Sep 25, 2007

    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.

    @theller
    Copy link

    theller commented Sep 25, 2007

    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.

    @janssen
    Copy link
    Mannequin Author

    janssen mannequin commented Sep 25, 2007

    Sorry, you're absolutely right. Here's a corrected patch.

    @theller
    Copy link

    theller commented Sep 25, 2007

    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) ?

    @janssen
    Copy link
    Mannequin Author

    janssen mannequin commented Oct 2, 2007

    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\>


    @theller
    Copy link

    theller commented Oct 11, 2007

    IMO os.uname() is preferable.
    Committed as SVN rev 58415 in trunk.
    Thanks.

    @theller theller closed this as completed Oct 11, 2007
    @theller theller self-assigned this Oct 11, 2007
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-mac stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant