-
-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
webbrowser.py triggers unwanted XQuartz startup #87277
Comments
For a long time, I wondered why opening Jupyter notebooks through nbopen always led to XQuartz starting. Now, I found the reason: nbopen uses webbrowser.py to open a web page, and webbrowser.py sees the Apparently, in order to be able to fire up XQuartz on demand and to allow people starting X11 applications, I am using Safari and find this starting of XQuartz undesirable (causes a delay, uses system resources, leads to a new running program in the Dock / task switcher). On the other hand I can totally understand that the code makes sense. As a workaround, I can unset DISPLAY, or uninstall xdg-utils (although it is useful, and may be a dependency of other ports), but I thought I should also bring it up here for discussion. |
3.7 is a few years old and only gets security fixes. Can you either test on current releases or whether code is still same? |
The same code is present in trunk. I'm in favour of disabling usage of X11 browsers of macOS, that's almost certainly not what users want. I no longer have XQuartz installed on my machine, but when I did I only used it for running X11 GUIs on remote Linux systems. What I'm not entirely sure about: is this something we should back port or just apply to the trunk (3.10)? This is a behaviour change and as such I'd be inclined to only apply to trunk. |
I was trying to be very honest, because I am still running 3.7 for production. However, I have carefully checked and the webbrowser.py has only seen (clearly) unrelated changes. |
I've created a PR for this. Open question: Is this a bug fix (with back ports to 3.9 and 3.8) or a feature (no back ports)? |
webbrowser is 'generous' at to what browsers it will open, some of which are not what hardly anyone would want. So I would call this an 'enhancement' (really 'disenchantment', like all removals;-) unless there were a technical reason other than those given for the exclusion. |
I've updated the version labels. The code change has not been applied to main yet (but I don't know whether it is still needed). |
I'm reviving the PR and will treat this as a new feature, that is I won't perform a back port of the PR. Primary reason for that is that using XQuartz in first place is a niche use case. |
The installation of XQuartz on macOS will unconditionally set the $DISPLAY variable. The X11 server will be launched when a program tries to access the display. This results in launching the X11 server when using the webbrowser module, even though X11 browsers won't be used in practice.
I've merged a fix for this in the main branch. I'm not backporting this because X11 usage on macOS should be extremely niche these days, but am willing to reconsider. |
…ython#24480) The installation of XQuartz on macOS will unconditionally set the $DISPLAY variable. The X11 server will be launched when a program tries to access the display. This results in launching the X11 server when using the webbrowser module, even though X11 browsers won't be used in practice.
…ython#24480) The installation of XQuartz on macOS will unconditionally set the $DISPLAY variable. The X11 server will be launched when a program tries to access the display. This results in launching the X11 server when using the webbrowser module, even though X11 browsers won't be used in practice.
…ython#24480) The installation of XQuartz on macOS will unconditionally set the $DISPLAY variable. The X11 server will be launched when a program tries to access the display. This results in launching the X11 server when using the webbrowser module, even though X11 browsers won't be used in practice.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: