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: webbrowser.py firefox bug [python3, windows 10]
Type: behavior Stage: needs patch
Components: Library (Lib), Tkinter, Windows Versions: Python 3.7
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: codextj, epaine, gregory.p.smith, paul.moore, punnapavankumar9, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-01-05 05:03 by codextj, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (6)
msg333039 - (view) Author: Tanmay Jain (codextj) Date: 2019-01-05 05:03
https://docs.python.org/3/library/webbrowser.html#webbrowser.controller.open

browser_controller = webbrowser.get()

result = browser_controller.open(url)# <-- return False even though firefox successfully opens url

# expected behavior when url is opened successfully in browser it should return True

# like it return True for chrome and edge.
msg333040 - (view) Author: Tanmay Jain (codextj) Date: 2019-01-05 05:09
>>> import webbrowser
>>> brwsr = webbrowser.get("C:/Program Files/Mozilla Firefox/firefox.exe %s")
>>> brwsr.open('www.google.com')
False # <-- even though firefox opens the url

>>> brwsr = webbrowser.get("C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s")
>>> brwsr.open('www.google.com')
True
>>> brwsr = webbrowser.get(using ='windows-default')
>>> brwsr.open('www.google.com')
True
>>>
msg340377 - (view) Author: Tanmay Jain (codextj) Date: 2019-04-17 02:06
Fix: If you set firefox as your default browser then we get correct return from browser_controller.open(url)
msg371728 - (view) Author: E. Paine (epaine) * Date: 2020-06-17 10:30
Your code works fine on Windows 10 2004 with Python 3.8.3 and Firefox 77.0.1 (Firefox not set to default browser).
msg393094 - (view) Author: pavan (punnapavankumar9) Date: 2021-05-06 14:19
Your code is working fine on windows 10 64-bit and returning True as it opens firefox. python-3.9.2. The issue should be closed.
msg393214 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2021-05-07 20:07
Others are reporting this works.  if that is not true on the most recent python 3.9 release, please reopen with more detailed reproduction instructions.
History
Date User Action Args
2022-04-11 14:59:09adminsetgithub: 79844
2021-05-07 20:07:59gregory.p.smithsetstatus: open -> closed

nosy: + gregory.p.smith
messages: + msg393214

resolution: works for me
stage: needs patch
2021-05-06 14:19:43punnapavankumar9setnosy: + punnapavankumar9
messages: + msg393094
2020-06-17 10:30:37epainesetnosy: + epaine
messages: + msg371728
2019-04-17 02:06:53codextjsetmessages: + msg340377
2019-01-05 05:09:09codextjsetmessages: + msg333040
2019-01-05 05:03:52codextjcreate