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

Gestalt() is deprecated on OSX 10.8, remove support? #62593

Closed
ronaldoussoren opened this issue Jul 7, 2013 · 10 comments
Closed

Gestalt() is deprecated on OSX 10.8, remove support? #62593

ronaldoussoren opened this issue Jul 7, 2013 · 10 comments
Assignees
Labels
easy OS-mac type-bug An unexpected behavior, bug, or error

Comments

@ronaldoussoren
Copy link
Contributor

BPO 18393
Nosy @malemburg, @ronaldoussoren, @ned-deily
Files
  • issue-18393.txt
  • 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/ronaldoussoren'
    closed_at = <Date 2013-07-15.16:38:00.178>
    created_at = <Date 2013-07-07.09:11:17.828>
    labels = ['OS-mac', 'easy', 'type-bug']
    title = 'Gestalt() is deprecated on OSX 10.8, remove support?'
    updated_at = <Date 2013-07-16.06:32:31.731>
    user = 'https://github.com/ronaldoussoren'

    bugs.python.org fields:

    activity = <Date 2013-07-16.06:32:31.731>
    actor = 'python-dev'
    assignee = 'ronaldoussoren'
    closed = True
    closed_date = <Date 2013-07-15.16:38:00.178>
    closer = 'ronaldoussoren'
    components = ['macOS']
    creation = <Date 2013-07-07.09:11:17.828>
    creator = 'ronaldoussoren'
    dependencies = []
    files = ['30861']
    hgrepos = []
    issue_num = 18393
    keywords = ['patch', 'easy', 'needs review']
    message_count = 10.0
    messages = ['192526', '192627', '192635', '192637', '192641', '192642', '192645', '193116', '193119', '193156']
    nosy_count = 4.0
    nosy_names = ['lemburg', 'ronaldoussoren', 'ned.deily', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue18393'
    versions = ['Python 3.4']

    @ronaldoussoren
    Copy link
    Contributor Author

    In OSX 10.8 the Gestalt() funtion in CoreServices is deprecated. This function is used in the _gestalt extension and exported to Python code.

    The only in-tree user of this (private) extension is the platform module, it uses gestalt as one of the alternatives to get the OSX release; and a fallback at that.

    A stackoverflow user has done some sleuthing and discovered that the gestalt function uses the same XML file to determine the OSX release as is used by the primary alternative used by the platform module (see <http://stackoverflow.com/questions/11072804/mac-os-x-10-8-replacement-for-gestalt-for-testing-os-version-at-runtime\>). The gestalt alternative will therefore likely be useful at all (it is only used when the file it reads is not available in the first place).

    The easiest solution to avoid this deprecated API is therefore to drop the _gestalt extension and remove its use in platform.mac_ver()

    @ronaldoussoren ronaldoussoren self-assigned this Jul 7, 2013
    @ronaldoussoren ronaldoussoren added OS-mac easy type-bug An unexpected behavior, bug, or error labels Jul 7, 2013
    @ronaldoussoren
    Copy link
    Contributor Author

    The attached patch removes the use of the Gestalt API.

    The removed code is effectively dead, I yet have to find a machine were platform._mac_ver_xml does not work and the gestalt based code only gets used when the XML variant does not work.

    @malemburg
    Copy link
    Member

    On 07.07.2013 11:11, Ronald Oussoren wrote:

    The easiest solution to avoid this deprecated API is therefore to drop the _gestalt extension and remove its use in platform.mac_ver()

    I think it should only be removed in case we no longer support
    Mac OS X platforms that still have it. Otherwise, please simply
    follow our standard procedure for deprecating public functions.

    @ronaldoussoren
    Copy link
    Contributor Author

    Do we follow the deprecation procedure for private functions as well?

    The patch removes a private and undocumented extension, and removes a private function that uses that extension. There is no change in the public API.

    Also, as I mentioned before the removed code is effectively dead because it will never be called on systems that aren't totally broken.

    @malemburg
    Copy link
    Member

    On 08.07.2013 13:55, Ronald Oussoren wrote:

    Do we follow the deprecation procedure for private functions as well?

    The patch removes a private and undocumented extension, and removes a private function that uses that extension. There is no change in the public API.

    Also, as I mentioned before the removed code is effectively dead because it will never be called on systems that aren't totally broken.

    Oh, I was under the impression that the API is public. I just did a
    grep: the _gestalt module is not documented and neither is the
    gestalt function, so I guess we can speed up the deprecation procedure
    or even drop it right away in 3.4 :-)

    @ronaldoussoren
    Copy link
    Contributor Author

    I had hoped to just drop it in 3.4.

    To remove:

    • extension _gestalt

    • function platform._mac_ver_gestalt

    • function platform._mac_ver_lookup (only used by ^^^)

    • function platform._bcd2str (likewise)

    To change:

    • function platform.mac_ver: remove call to _mac_ver_gestalt

    @malemburg
    Copy link
    Member

    On 08.07.2013 14:08, Ronald Oussoren wrote:

    Ronald Oussoren added the comment:

    I had hoped to just drop it in 3.4.

    To remove:

    • extension _gestalt

    • function platform._mac_ver_gestalt

    • function platform._mac_ver_lookup (only used by ^^^)

    • function platform._bcd2str (likewise)

    To change:

    • function platform.mac_ver: remove call to _mac_ver_gestalt

    Fine with me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 15, 2013

    New changeset ccbaf6762b54 by Ronald Oussoren in branch 'default':
    Issue bpo-18393: Remove use of deprecated API on OSX
    http://hg.python.org/cpython/rev/ccbaf6762b54

    @ronaldoussoren
    Copy link
    Contributor Author

    I won't backport to 3.3 or 2.7, it is highly unlikely that the API will actually be removed anytime soon.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 16, 2013

    New changeset 7272ef213b7c by Ronald Oussoren in branch 'default':
    Also remove a (broken) leaker test for the code removed in issue bpo-18393.
    http://hg.python.org/cpython/rev/7272ef213b7c

    @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
    easy OS-mac type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants