[New-bugs-announce] [issue43111] webbrowser.py triggers unwanted XQuartz startup

hans.meine report at bugs.python.org
Wed Feb 3 04:21:34 EST 2021

New submission from hans.meine <hans_meine at gmx.net>:

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 `DISPLAY` variable being set and calls xdg-settings (which I installed via the xdg-utils port / MacPorts).

Apparently, in order to be able to fire up XQuartz on demand and to allow people starting X11 applications, `DISPLAY` is set to a string like `/private/tmp/com.apple.launchd.<somecode>/org.xquartz:0`.

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.

components: Library (Lib), macOS
messages: 386182
nosy: hans-meine, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: webbrowser.py triggers unwanted XQuartz startup
type: resource usage
versions: Python 3.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list