]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 29 Dec 2023 08:57:21 +0000 (09:57 +0100)
committerGitHub <noreply@github.com>
Fri, 29 Dec 2023 08:57:21 +0000 (09:57 +0100)
gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (GH-113544)
(cherry picked from commit fba324154e65b752e42aa59dea287d639935565f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
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 44974d433b46966d98cd3cc9d5dcb22d60b0feed..5d72524c0876774727c3aed4fdbc8ea9b50464e4 100755 (executable)
@@ -688,6 +688,7 @@ if sys.platform == 'darwin':
             self.name = val
 
         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.