Skip to content

Commit 549e628

Browse files
authoredJan 3, 2022
bpo-40477: macOS Python Launcher app fixes for recent macOS releases (pythonGH-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.
1 parent fedefa6 commit 549e628

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed
 

‎Mac/PythonLauncher/Info.plist.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
6-
<string>English</string>
6+
<string>en</string>
77
<key>CFBundleDocumentTypes</key>
88
<array>
99
<dict>
@@ -39,6 +39,8 @@
3939
</array>
4040
<key>CFBundleExecutable</key>
4141
<string>Python Launcher</string>
42+
<key>NSHumanReadableCopyright</key>
43+
<string>Copyright © 2001-2022 Python Software Foundation</string>
4244
<key>CFBundleGetInfoString</key>
4345
<string>%VERSION%, © 2001-2022 Python Software Foundation</string>
4446
<key>CFBundleIconFile</key>
@@ -61,5 +63,7 @@
6163
<string>MainMenu</string>
6264
<key>NSPrincipalClass</key>
6365
<string>NSApplication</string>
66+
<key>NSAppleEventsUsageDescription</key>
67+
<string>Python Launcher uses Apple events to launch your Python script in a Terminal window.</string>
6468
</dict>
6569
</plist>

‎Mac/PythonLauncher/doscript.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
AEDesc desc;
2020
OSStatus err;
2121

22-
[[NSWorkspace sharedWorkspace] launchApplication:@"/Applications/Utilities/Terminal.app/"];
22+
[[NSWorkspace sharedWorkspace] launchApplication:@"Terminal.app"];
2323

2424
// Build event
2525
err = AEBuildAppleEvent(kAECoreSuite, kAEDoScript,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The Python Launcher app for macOS now properly launches scripts and, if
2+
necessary, the Terminal app when running on recent macOS releases.

0 commit comments

Comments
 (0)