Skip to content

MacOSXOSAScript does not send webbrowser.open audit event #113543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sobolevn opened this issue Dec 28, 2023 · 0 comments
Closed

MacOSXOSAScript does not send webbrowser.open audit event #113543

sobolevn opened this issue Dec 28, 2023 · 0 comments
Assignees
Labels
OS-mac stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Dec 28, 2023

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

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error OS-mac stdlib Python modules in the Lib dir labels Dec 28, 2023
@sobolevn sobolevn self-assigned this Dec 28, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Dec 28, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 28, 2023
…pen` audit event (pythonGH-113544)

(cherry picked from commit fba3241)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 28, 2023
…pen` audit event (pythonGH-113544)

(cherry picked from commit fba3241)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
ronaldoussoren pushed a commit that referenced this issue Dec 29, 2023
…open` audit event (GH-113544) (#113549)

gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (GH-113544)
(cherry picked from commit fba3241)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
ronaldoussoren pushed a commit that referenced this issue Dec 29, 2023
…open` audit event (GH-113544) (#113550)

gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (GH-113544)
(cherry picked from commit fba3241)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
kulikjak pushed a commit to kulikjak/cpython that referenced this issue Jan 22, 2024
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants