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.open doesn't work in Termux
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: DonaldDuck1313, steven.daprano, terry.reedy, xdegaye
Priority: normal Keywords:

Created on 2021-12-31 16:11 by DonaldDuck1313, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 30106 open DonaldDuck1313, 2021-12-31 16:11
Messages (3)
msg409422 - (view) Author: DonaldDuck313 (DonaldDuck1313) * Date: 2021-12-31 16:11
In Termux, if I type the following code, I would expect it to open the URL in a browser, but it does nothing:

import webbrowser
webbrowser.open("http://example.com")
msg409438 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-12-31 22:37
https://termux.com/ "Termux is an Android terminal emulator [on Android] and Linux environment app"

I don't believe that core devs (and b.p.o.) support running Python on Android.  If so, this should be closed here and your question redirected to whoever supplied your Android python installer.  They might just say that Termux is not a supported terminal.
msg409447 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2022-01-01 02:06
I think the existence of sys.getandroidapilevel is evidence that Android is somewhat supported, even if it is not supported to the same degree that Linux and Windows are.

https://docs.python.org/3/library/sys.html#sys.getandroidapilevel

See also:

https://mail.python.org/pipermail/python-dev/2017-December/151171.html

for a longer discussion. There's an Android build factory

https://github.com/python/buildmaster-config/pull/26

but I cannot see an official Android buildbot running.

https://buildbot.python.org/all/#/

The PR seems straightforward and simple to me, but I'm not an expert on the webbrowser module nor do I have an Android where I can test it to see if it works.

DonaldDuck1313, your NEWS entry needs to be re-written to use ReST (Restructured Text) rather than Markdown:

Change: [Termux](https://termux.com/)

to `Termux <https://termux.com/>`_
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90371
2022-01-01 02:06:28steven.dapranosetnosy: + xdegaye, steven.daprano
type: enhancement
messages: + msg409447
2021-12-31 22:37:58terry.reedysetnosy: + terry.reedy
messages: + msg409438
2021-12-31 16:11:15DonaldDuck1313create