summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-01-03 06:48:21 (GMT)
committerGitHub <noreply@github.com>2022-01-03 06:48:21 (GMT)
commit50da397be4f71e5c12759281446b06ce14b6a5c4 (patch)
tree9d0130df917cde3b51a1af5445f136249b734d51
parentb28b0222e360669463ffe31d27c1fd374361cb23 (diff)
downloadcpython-50da397be4f71e5c12759281446b06ce14b6a5c4.zip
cpython-50da397be4f71e5c12759281446b06ce14b6a5c4.tar.gz
cpython-50da397be4f71e5c12759281446b06ce14b6a5c4.tar.bz2
bpo-40477: macOS Python Launcher app fixes for recent macOS releases (GH-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 549e62827262264cda30455e10e315602129da72) Co-authored-by: Ned Deily <nad@python.org>
-rw-r--r--Mac/PythonLauncher/Info.plist.in6
-rw-r--r--Mac/PythonLauncher/doscript.m2
-rw-r--r--Misc/NEWS.d/next/macOS/2022-01-02-21-56-53.bpo-40477.W3nnM6.rst2
3 files changed, 8 insertions, 2 deletions
diff --git a/Mac/PythonLauncher/Info.plist.in b/Mac/PythonLauncher/Info.plist.in
index 70f215d..dec0a2e 100644
--- a/Mac/PythonLauncher/Info.plist.in
+++ b/Mac/PythonLauncher/Info.plist.in
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
- <string>English</string>
+ <string>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
@@ -39,6 +39,8 @@
</array>
<key>CFBundleExecutable</key>
<string>Python Launcher</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2001-2022 Python Software Foundation</string>
<key>CFBundleGetInfoString</key>
<string>%VERSION%, © 2001-2022 Python Software Foundation</string>
<key>CFBundleIconFile</key>
@@ -61,5 +63,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
+ <key>NSAppleEventsUsageDescription</key>
+ <string>Python Launcher uses Apple events to launch your Python script in a Terminal window.</string>
</dict>
</plist>
diff --git a/Mac/PythonLauncher/doscript.m b/Mac/PythonLauncher/doscript.m
index cbb783b..f07326b 100644
--- a/Mac/PythonLauncher/doscript.m
+++ b/Mac/PythonLauncher/doscript.m
@@ -19,7 +19,7 @@ doscript(const char *command)
AEDesc desc;
OSStatus err;
- [[NSWorkspace sharedWorkspace] launchApplication:@"/Applications/Utilities/Terminal.app/"];
+ [[NSWorkspace sharedWorkspace] launchApplication:@"Terminal.app"];
// Build event
err = AEBuildAppleEvent(kAECoreSuite, kAEDoScript,
diff --git a/Misc/NEWS.d/next/macOS/2022-01-02-21-56-53.bpo-40477.W3nnM6.rst b/Misc/NEWS.d/next/macOS/2022-01-02-21-56-53.bpo-40477.W3nnM6.rst
new file mode 100644
index 0000000..fc953b8
--- /dev/null
+++ b/Misc/NEWS.d/next/macOS/2022-01-02-21-56-53.bpo-40477.W3nnM6.rst
@@ -0,0 +1,2 @@
+The Python Launcher app for macOS now properly launches scripts and, if
+necessary, the Terminal app when running on recent macOS releases.