Sitelet https://github.com/python/cpython/issues/113543
Skip to content

MacOSXOSAScript does not send webbrowser.open audit event #113543

Description

@sobolevn

Bug report

All other browsers do this:

But, not MacOSXOSAScript:

cpython/Lib/webbrowser.py

Lines 576 to 593 in f108468

def open(self, url, new=0, autoraise=True):
if self.name == 'default':
script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
else:
script = f'''
tell application "%s"
activate
open location "%s"
end
'''%(self.name, url.replace('"', '%22'))
osapipe = os.popen("osascript", "w")
if osapipe is None:
return False
osapipe.write(script)
rc = osapipe.close()
return not rc

I think that this needs to be fixed.

Found this while looking at #113539

Linked PRs

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

OS-macstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions