FS#59567 - [python] webbrowser module is broken when using $BROWSER
Attached to Project:
Arch Linux
Opened by Guido Masella (gdmsl) - Wednesday, 08 August 2018, 13:40 GMT
Last edited by Toolybird (Toolybird) - Saturday, 21 January 2023, 21:54 GMT
Opened by Guido Masella (gdmsl) - Wednesday, 08 August 2018, 13:40 GMT
Last edited by Toolybird (Toolybird) - Saturday, 21 January 2023, 21:54 GMT
|
Details
Description:
Jupyter notebook does not start after updating python (3.6.6-1 -> 3.7.0-3) Additional info: jupyter 4.1.0-6 jupyter-notebook 5.3.0-4 python-tornado 5.1.0-1 Steps to reproduce: try to start jupyter notebook with jupyter notebook |
This task depends upon
Closed by Toolybird (Toolybird)
Saturday, 21 January 2023, 21:54 GMT
Reason for closing: Fixed
Additional comments about closing: @duthils says "Unreproducible with latest version"
Saturday, 21 January 2023, 21:54 GMT
Reason for closing: Fixed
Additional comments about closing: @duthils says "Unreproducible with latest version"
FS#59535is related. I just found out that running `jupyter notebook --no-borwser` will successfully start jupyter notebook. Probably it is due to a bug somewere in /usr/lib/python3.7/webbrowser.py . Is that possible? If I try to call webbrowser.get() from a python script I get the same error.Python 3.7.0 (default, Jul 15 2018, 10:44:58)
[GCC 8.1.1 20180531] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.get()
<webbrowser.Chrome object at 0x7f2f2e45e7f0>
>>> print(webbrowser.__file__)
/usr/lib/python3.7/webbrowser.py
>>>
Though I'd say, that it's not just Jupyter related, but more or less an issue of python itself:
$ python
Python 3.7.0 (default, Jul 15 2018, 10:44:58)
[GCC 8.1.1 20180531] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.get()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/webbrowser.py", line 42, in get
register_standard_browsers()
File "/usr/lib/python3.7/webbrowser.py", line 567, in register_standard_browsers
cmd = _synthesize(cmdline, -1)
File "/usr/lib/python3.7/webbrowser.py", line 116, in _synthesize
register(browser, None, controller, update_tryorder)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given
>>> print(webbrowser.__file__)
/usr/lib/python3.7/webbrowser.py
>>>
$ sudo pacman -Qo /usr/lib/python3.7/webbrowser.py
/usr/lib/python3.7/webbrowser.py is owned by python 3.7.0-3
Upstream fix: https://github.com/python/cpython/pull/7267
This has also been backported to the python 3.7 stable branch: https://github.com/python/cpython/pull/8183
The cause is that the _synthesize() function in the stdlib "webbrowser" module, which parses $BROWSER, was not included in a refactoring that broke things internally as a result. If you don't use $BROWSER then everything just works.