]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-137586: Open external osascript program with absolute path (GH-137584)...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Apr 2026 03:35:14 +0000 (05:35 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Apr 2026 03:35:14 +0000 (03:35 +0000)
Co-authored-by: Fionn <1897918+fionn@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Lib/test/test_webbrowser.py
Lib/turtledemo/__main__.py
Lib/webbrowser.py
Misc/NEWS.d/next/macOS/2025-10-17-01-07-03.gh-issue-137586.kVzxvp.rst [new file with mode: 0644]

index 3b3b0ae8c77745526af7a54fa7793f942c71b11b..e8b8b020deadb1b480c2e1c61325fd6c6ea35c17 100644 (file)
@@ -350,7 +350,7 @@ class MacOSXOSAScriptTest(unittest.TestCase):
         url = "https://python.org"
         self.browser.open(url)
         self.assertTrue(self.popen_pipe._closed)
-        self.assertEqual(self.popen_pipe.cmd, "osascript")
+        self.assertEqual(self.popen_pipe.cmd, "/usr/bin/osascript")
         script = self.popen_pipe.pipe.getvalue()
         self.assertEqual(script.strip(), f'open location "{url}"')
 
index 8dbda474bb3efd81844461a3857676c0f91889b1..967ccb0f15308a94f16d5380bb384d7e7d080d1c 100755 (executable)
@@ -138,7 +138,7 @@ class DemoWindow(object):
             # so that our menu bar appears.
             subprocess.run(
                     [
-                        'osascript',
+                        '/usr/bin/osascript',
                         '-e', 'tell application "System Events"',
                         '-e', 'set frontmost of the first process whose '
                               'unix id is {} to true'.format(os.getpid()),
index dc8359dd1a456694850fc99d4b9d44df1b8f3e74..ee5824100c7b9a661f3b8e4f9949a567f6e9e779 100755 (executable)
@@ -619,7 +619,7 @@ if sys.platform == 'darwin':
                    end
                    '''
 
-            osapipe = os.popen("osascript", "w")
+            osapipe = os.popen("/usr/bin/osascript", "w")
             if osapipe is None:
                 return False
 
diff --git a/Misc/NEWS.d/next/macOS/2025-10-17-01-07-03.gh-issue-137586.kVzxvp.rst b/Misc/NEWS.d/next/macOS/2025-10-17-01-07-03.gh-issue-137586.kVzxvp.rst
new file mode 100644 (file)
index 0000000..8e42065
--- /dev/null
@@ -0,0 +1 @@
+Invoke :program:`osascript` with absolute path in :mod:`webbrowser` and :mod:`!turtledemo`.