Importing webbrowser has a side effect. It outputs a message on stderr. >>> import webbrowser /usr/bin/xdg-settings: 1: /usr/bin/xdg-settings: kreadconfig5: not found This is a regression introduced in .
Just stderr. stdout contains the requested value. And I think that an external program shouldn't be ran at import time. It would be better to defer its run until its output is required.
Ah, and I think I'm not seeing this locally because I have both Gtk and KDE components installed (my main desktop is KDE, but Firefox and various other components are still Gtk apps).
I considered that problem of "subprocess invocation as a side-effect of import", but in this case the output is needed by the immediately following "register_X_browsers()" call, as it affects how those browsers get inserted into webbrowser._tryorder. That means there isn't any obvious way to delay it without a fairly significant refactoring of how the module works :(
The specific problem reported has been resolved, so closing this one. If anyone's able to figure out a way to defer this to post-import somehow, I think that would make a good enhancement proposal.