Ned Deily <n...@python.org> added the comment:

Thanks, Ronald, for tracking down the NSAppleEventsUsageDescription requirement!

The PR here solves two problems encountered by users of the macOS Python 
Launcher app on recent macOS releases (10.14+):

1. The launcher app was no longer able to launch the macOS Terminal.app to run 
a script.

2. Even if Terminal.app was already launched, the launcher app was unable to 
send an Apple Event to Terminal.app to open and run Python with the desired .py 
file.

The solution to item 1 was to no longer specify an absolute path to 
Terminal.app but rather let LaunchServices figure out the path.

Item 2 was fixed by adding the NSAppleEventsUsageDescription key to the 
launcher app's property list. The first time the launcher runs, macOS displays 
a message to the user requesting permission to use Apple events; if granted by 
the user, the launcher will now be able to send open events to Terminal.app and 
all is well.

Tested on the most recent releases of macOS 12, 11, 10.16, 10.15, 10.14, and 
10.9 and on both Intel and Apple Silicon Macs.

Merged for release in 3.9.10, 3.10.2, and 3.11.0a4.

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40477>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to