[3.12] gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (GH-113544) (#113549)

https://github.com/python/cpython/commit/c0de843c12f4f3959799eaa730cd56852f6... commit: c0de843c12f4f3959799eaa730cd56852f6c20ef branch: 3.12 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: ronaldoussoren <ronaldoussoren@mac.com> date: 2023-12-29T09:56:18+01:00 summary: [3.12] gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (GH-113544) (#113549) 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> files: A Misc/NEWS.d/next/Library/2023-12-28-14-36-20.gh-issue-113543.2iWkOR.rst M Lib/webbrowser.py diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index e0170afdf4da7d..ba6711e4ef5c33 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -634,6 +634,7 @@ def _name(self, val): 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 00000000000000..5bf557bedd0204 --- /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.
participants (1)
-
ronaldoussoren