This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author guido.fioravantti
Recipients guido.fioravantti, paul.moore, steve.dower, tim.golden, zach.ware
Date 2021-10-23.17:33:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635010402.44.0.770979979986.issue45589@roundup.psfhosted.org>
In-reply-to
Content
The 'webbrowser' module throws warnings and bad RC codes when running under Windows Subsystem for Linux (WSL).

This causes libraries that depend on the 'webbrowser' module to mistakenly assume there's been an error opening a URL. An example of this behaviour can be observed running `jupyter-lab` under WSL.

Steps to reproduce:
1. Run Ubuntu (for example) under Windows WSL.
2. `python -m webbrowser https://www.python.org`

Expected result:

The wesite opens.

Actual result:

The website opens but produces a `No valid TTY` message, which also yields a non-zero return code.

I have a patch for this bug that inspects the kernel version (platform.uname) and detects WSL. This is a similar solution that other projects have implemented to tackle this problem. For example, the fish shell project: https://github.com/fish-shell/fish-shell/blob/0e06a53dff5e198c4fcefb6419a53cf1267231a1/share/functions/help.fish#L83.
History
Date User Action Args
2021-10-23 17:33:22guido.fioravanttisetrecipients: + guido.fioravantti, paul.moore, tim.golden, zach.ware, steve.dower
2021-10-23 17:33:22guido.fioravanttisetmessageid: <1635010402.44.0.770979979986.issue45589@roundup.psfhosted.org>
2021-10-23 17:33:22guido.fioravanttilinkissue45589 messages
2021-10-23 17:33:22guido.fioravantticreate