From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 29 Dec 2023 08:57:21 +0000 (+0100) Subject: [3.11] gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit... X-Git-Tag: v3.11.8~206 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ced2d3552374de053bd8a09ae64e5a3cb75d0b1e;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (GH-113544) (#113550) gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (GH-113544) (cherry picked from commit fba324154e65b752e42aa59dea287d639935565f) Co-authored-by: Nikita Sobolev --- diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 44974d433b46..5d72524c0876 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -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 index 000000000000..5bf557bedd02 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-12-28-14-36-20.gh-issue-113543.2iWkOR.rst @@ -0,0 +1,2 @@ +Make sure that ``webbrowser.MacOSXOSAScript`` sends ``webbrowser.open`` +audit event.