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.

classification
Title: The command line of launching Edge on Linux hangs
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, rayluo, steve.dower, terry.reedy
Priority: normal Keywords: easy, newcomer friendly, patch

Created on 2021-08-05 18:58 by rayluo, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 29908 open steve.dower, 2021-12-03 23:08
Messages (3)
msg399030 - (view) Author: Ray Luo (rayluo) Date: 2021-08-05 18:58
Launching Chrome on Linux from command line:

    $ export BROWSER=google-chrome; python -m webbrowser https://httpbin.org/delay/10

    It can successfully launch Chrome with the specified web page opened in a new tab.
    And the console command line finishes BEFORE the web page being fully loaded in the browser. That is the desirable behavior.

Launching Edge on Linux from command line:

    $ export BROWSER=microsoft-edge; python -m webbrowser https://httpbin.org/delay/10

    The command line hangs until the Edge window is closed.

That hanging symptom can be resolved by writing a deliberate script to webbrowser.register("...", None, webbrowser.BackgroundBrowser("microsoft-edge")) and then use that registered browser. But it was not obvious, and it took trial-and-error to reach that solution.

Could it be possible to have the "BROWSER=microsoft-edge; python -m webbrowser https://httpbin.org/delay/10" work out of the box, without hanging?

Is it because Edge is not currently predefined and handled inside webbrowser.py? It seems not an easy decision to add new browser into webbrowser.py, though, based on the 2nd and 3rd comments in this old issue: https://bugs.python.org/issue42330
msg399037 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-08-05 20:22
Adding a new browser should be pretty easy, and it seems like that's all that is needed here. It has to go into a few places though to support each platform, and unfortunately it's only good for 3.11, and not any of the existing releases.
msg407614 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-12-03 23:10
@Ray I posted a PR that works fine on Windows, would you be able to try it on Linux? The executables seem to have different names, so I'm a little concerned about the change, but I think it should be alright.
History
Date User Action Args
2022-04-11 14:59:48adminsetgithub: 89007
2021-12-03 23:10:09steve.dowersetmessages: + msg407614
2021-12-03 23:08:46steve.dowersetpull_requests: + pull_request28132
2021-12-03 22:48:54steve.dowersetpull_requests: - pull_request27916
2021-11-20 18:51:38terry.reedysetmessages: - msg406684
2021-11-20 18:51:23terry.reedysetmessages: - msg406680
2021-11-20 18:50:26miss-islingtonsetpull_requests: + pull_request27916
2021-11-20 18:47:40terry.reedysetpull_requests: - pull_request27913
2021-11-20 18:47:32terry.reedysetpull_requests: - pull_request27912
2021-11-20 18:47:24terry.reedysetpull_requests: - pull_request27892
2021-11-20 18:44:13miss-islingtonsetmessages: + msg406684
2021-11-20 18:24:51miss-islingtonsetpull_requests: + pull_request27913
2021-11-20 18:21:28terry.reedysetmessages: + msg406680
2021-11-20 18:21:25miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27912
2021-11-20 01:38:07terry.reedysetpull_requests: + pull_request27892
2021-11-20 01:37:25terry.reedysetpull_requests: - pull_request27889
2021-11-20 01:35:57terry.reedysetkeywords: + patch
nosy: + terry.reedy

pull_requests: + pull_request27889
stage: patch review
2021-08-05 20:22:06steve.dowersetversions: + Python 3.11, - Python 3.7
nosy: + steve.dower

messages: + msg399037

keywords: + easy, newcomer friendly
2021-08-05 18:58:31rayluocreate