Skip to content
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

gh-128540: Fixed webbrowser.open with file: URLs may launching editor instead of browser #130031

Closed
wants to merge 1 commit into from

Conversation

Wulian233
Copy link
Contributor

@Wulian233 Wulian233 commented Feb 12, 2025

Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. I know of at least one instance where this will cause a significant break: by default the Pythons installed using the python.org macOS installers include a copy of the Python HTML documentation. On macOS, IDLE will look for that copy of the HTML documentation and, if found, will attempt to open it by passing a file: URL to webbrowser.open. Browsing the docs in IDLE is usually invoked with the F1 key. With this PR, pressing F1 causes IDLE to do nothing. There may be other existing users of webbrowser.open that would be similarly affected. I'm not sure what the best solution is but as it stands I don't think we can apply this as is.

@bedevere-app
Copy link

bedevere-app bot commented Feb 13, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@Wulian233
Copy link
Contributor Author

Wulian233 commented Feb 13, 2025

This seems to be a case of mutual exclusivity, where supporting the needs of some users without adding a new parameter might not be feasible given the existing calls in Python. There's no way to control what behavior users actually want. jupyter-server/jupyter_server#1488

My only idea is to introduce a new parameter, open, defaulting to False. This would be a new feature (3.14+), and the browser would only open when explicitly set to True, while keeping the current behavior as the default.🤔 What do you think?

@ned-deily
Copy link
Member

ned-deily commented Feb 13, 2025

After thinking about it some more, I commented here on the issue. Let's try to resolve that first before proceeding further with a code change. Thanks for working on it!

@Wulian233
Copy link
Contributor Author

The current behavior of webbrowser still needs discussion, #128540 (comment) I decided to close it for now 😊

@Wulian233 Wulian233 closed this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants