]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event ...
authorNikita Sobolev <mail@sobolevn.me>
Thu, 28 Dec 2023 18:58:06 +0000 (21:58 +0300)
committerGitHub <noreply@github.com>
Thu, 28 Dec 2023 18:58:06 +0000 (19:58 +0100)
Lib/webbrowser.py
Misc/NEWS.d/next/Library/2023-12-28-14-36-20.gh-issue-113543.2iWkOR.rst [new file with mode: 0644]

index 6f9c6a6de177e6311e0363554d5565e17da52458..636e8ca459d1091e11b152978989964ef13890a7 100755 (executable)
@@ -574,6 +574,7 @@ if sys.platform == 'darwin':
             super().__init__(name)
 
         def open(self, url, new=0, autoraise=True):
+            sys.audit("webbrowser.open", url)
             if self.name == 'default':
                 script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
             else:
diff --git a/Misc/NEWS.d/next/Library/2023-12-28-14-36-20.gh-issue-113543.2iWkOR.rst b/Misc/NEWS.d/next/Library/2023-12-28-14-36-20.gh-issue-113543.2iWkOR.rst
new file mode 100644 (file)
index 0000000..5bf557b
--- /dev/null
@@ -0,0 +1,2 @@
+Make sure that ``webbrowser.MacOSXOSAScript`` sends ``webbrowser.open``
+audit event.