]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] 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:21 +0000 (05:35 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Apr 2026 03:35:21 +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 a3b31f169d72c67150396408bbe3f8d288cba0ca..c9f8f1bb8f16d8c97b066e7ff086ad3a2b38ec1d 100644 (file)
@@ -267,7 +267,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 caea022da4a68807838e9ca171b58d57856a181a..40ebcb8c90b8b9cee83bb47d24516f8584dad7e1 100755 (executable)
@@ -137,7 +137,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 98904163c28c7739022593c2d68ba4a16f804dcb..866633790860c3c1e2423e934d700d32a64e2957 100755 (executable)
@@ -694,7 +694,7 @@ if sys.platform == 'darwin':
                    end
                    '''%(self._name, url.replace('"', '%22'))
 
-            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`.