gh-128540: lookup default webbrowser on macOS#130535
Merged
ned-deily merged 3 commits intopython:mainfrom Mar 14, 2025
Merged
Conversation
ensures web browser is launched on mac, even for URLs that are not http[s].
4daff9f to
26e799b
Compare
This was referenced Feb 25, 2025
ned-deily
approved these changes
Mar 14, 2025
Member
ned-deily
left a comment
There was a problem hiding this comment.
LGTM, thanks for all of your work on this issue. I'm going to approve to merge this for the next 3.14 alpha. We should try to get the other PRs reviewed and merged soon.
|
This was referenced Mar 16, 2025
plashchynski
pushed a commit
to plashchynski/cpython
that referenced
this pull request
Mar 17, 2025
Ensure web browser is launched by `webbrowser.open` on macOS, even for `file://` URLs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ensures web browser is launched on mac, even for URLs that are not http[s]. Only does the lookup for non-http URLs, limiting the impact of the change.
I'm not sure what level of testing is appropriate, but I added some basic exercise for MacOSXOSAScript. The subprocess is mocked, so the correctness of the applescript still itself isn't tested at all.
Addresses gh-128540 on macOS only. I'll open separate PRs per platform, as recommended by @ned-deily.
More discussion in https://discuss.python.org/t/support-for-file-urls-in-webbrowser-open/81612
Backported implementation in https://pypi.org/project/webbrowser-open/