This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Call to gestalt('sysu') on OSX can lead to freeze in wxPython apps
Type: behavior Stage: resolved
Components: macOS Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: phansen, robind, ronaldoussoren
Priority: normal Keywords:

Created on 2010-01-30 15:54 by phansen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg98565 - (view) Author: Peter Hansen (phansen) Date: 2010-01-30 15:57
In platform.mac_ver() there is a call to look up Mac version info, which results in a call to gestalt.gestalt('sysu').  This call is useless since, as documented in comments in the function the "sysu" option no longer exists, but the call was left in "as documentation".  

Unfortunately, as described in http://groups.google.com/group/wxpython-users/browse_thread/thread/ced6c57cc84cb252 this call has the unfortunate and mysterious (but conclusively proven) side effect of preventing a wxPython app from running the GUI main loop in any thread other than the main thread (or rather, the one in which this failing call to gestalt() is first made).

See also http://bugs.python.org/issue780461 for some related background.
msg98989 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-02-07 10:32
Two short notes:

1) The call to gestalt('sysu') is basicly dead code and will be removed

2) Running the GUI runloop in a thread that is not the main thread is AFAIK not supported by Apple. I'm not 100% sure about the Carbon libraries, but in Cocoa the main thread has special significance.
msg98990 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-02-07 11:35
Removed the call to gestalt('sysu') in r78056 (trunk), r78057 (2.6), r78058 (3.x), r78060 (3.1)

(Also changing the type to 'behavior' instead of 'crash' because this is not a crashing bug in python).
History
Date User Action Args
2022-04-11 14:56:57adminsetgithub: 52060
2010-02-07 11:35:56ronaldoussorensetstatus: open -> closed
type: crash -> behavior
messages: + msg98990

resolution: fixed
stage: resolved
2010-02-07 10:32:40ronaldoussorensetmessages: + msg98989
2010-01-30 20:32:59robindsetnosy: + robind
2010-01-30 16:00:22loewissetversions: - Python 2.5
2010-01-30 15:57:43phansensettitle: Call to gestalt('sysu') on -> Call to gestalt('sysu') on OSX can lead to freeze in wxPython apps
nosy: + ronaldoussoren

messages: + msg98565

assignee: ronaldoussoren
components: + macOS
2010-01-30 15:54:28phansencreate