-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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 does not handle opens under Windows WSL properly #89752
Comments
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 Steps to reproduce:
Expected result: The wesite opens. Actual result: The website opens but produces a 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. |
Windows people, do we support running on WSL? Is there a buildbot running it? |
We don't formally support it yet. We probably need somebody to develop expertise in the emulation layer so that they can work with the Linux distro experts to make sure their distros are doing things properly. It has no relation at all to our Windows support (right now) - all versions of Python running in WSL 100% believe they are running on whichever Linux distro the user is running. |
My code patch uses ‘wslview’, which is a binary that is injected into every I detect WSL inspecting the kernel version, which includes WSL tagging. On Tue, Nov 2, 2021 at 3:05 PM Steve Dower <[email protected]> wrote:
|
FWIW, I don't have wslview in the Debian distro I'm currently using. It Consistent detection and integration throughout CPython's standard |
Understood, my mistake. I wonder if explorer.exe or any other general purpose open command is For detection, there’re some other projects that have done this for some Might be worth looking into. On Tue, Nov 2, 2021 at 3:28 PM Steve Dower <[email protected]> wrote:
|
There's wslview, which seems to be installed by default in most WSL distros these days. The following works well: webbrowser.get("wslview %s").open("https://example.com") |
It looks like a typical solution in the node ecosystem uses the @zooba would a patch like that inside of Given that there's been no activity for a couple years on this issue, maybe system default |
I don't know the answer to that - WSL isn't actually Windows, so it's not really in my scope. It's the Linux build of Python that matters here. |
Ah, fair enough. Is there someone else we can ping to ask? |
This is only anecdotal from my own usage of WSL as my daily driver -- I have a new/default installation of Debian sid where
works through Since |
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: