Skip to content

bpo-40477: macOS Python Launcher app fixes for recent macOS releases#30348

Merged
ned-deily merged 1 commit into
python:mainfrom
ned-deily:bpo-40477-launcher-terminal
Jan 3, 2022
Merged

bpo-40477: macOS Python Launcher app fixes for recent macOS releases#30348
ned-deily merged 1 commit into
python:mainfrom
ned-deily:bpo-40477-launcher-terminal

Conversation

@ned-deily

@ned-deily ned-deily commented Jan 3, 2022

Copy link
Copy Markdown
Member

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.

Thanks to @ronaldoussoren for tracking down the NSAppleEventsUsageDescription requirement!

https://bugs.python.org/issue40477

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @ned-deily for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@ned-deily
ned-deily deleted the bpo-40477-launcher-terminal branch January 3, 2022 06:20
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jan 3, 2022
@bedevere-bot

Copy link
Copy Markdown

GH-30349 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 3, 2022
…ythonGH-30348)

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

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

- 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.
(cherry picked from commit 549e628)

Co-authored-by: Ned Deily <nad@python.org>
@bedevere-bot

Copy link
Copy Markdown

GH-30350 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 3, 2022
…ythonGH-30348)

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

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

- 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.
(cherry picked from commit 549e628)

Co-authored-by: Ned Deily <nad@python.org>
ned-deily added a commit that referenced this pull request Jan 3, 2022
…H-30348) (GH-30349)

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

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

- 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.
(cherry picked from commit 549e628)

Co-authored-by: Ned Deily <nad@python.org>
miss-islington added a commit that referenced this pull request Jan 3, 2022
…H-30348)

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

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

- 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.
(cherry picked from commit 549e628)

Co-authored-by: Ned Deily <nad@python.org>
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Arch Linux Asan 3.10 has failed when building commit b312794.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/633/builds/407) and take a look at the build logs.
  4. Check if the failure is related to this commit (b312794) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/633/builds/407

Summary of the results of the build (if available):

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.10.pablogsal-arch-x86_64.asan/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
    cache[rtype].remove(name)
KeyError: '/psm_f0db36c1'


Traceback (most recent call last):
  File "/buildbot/buildarea/3.10.pablogsal-arch-x86_64.asan/build/Lib/multiprocessing/resource_tracker.py", line 209, in main
    cache[rtype].remove(name)
KeyError: '/psm_c4ae8d17'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants