Message322439
Description: When BROWSER is set, webbrowser.get fails because register_standard_browsers throws an error.
Work around: You can still use `webbroswer._browsers[key][1].open(url)` to open a browser.
Operating system: macOS High Sierra v10.13.6
Reproduction 1:
```
➜ BROWSER=lynx python3
Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
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/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py", line 42, in get
register_standard_browsers()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py", line 567, in register_standard_browsers
cmd = _synthesize(cmdline, -1)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/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
```
Reproduction 2:
```
➜ BROWSER=lynx python3
Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.register_standard_browsers()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py", line 567, in register_standard_browsers
cmd = _synthesize(cmdline, -1)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/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
>>> webbrowser.lynx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'webbrowser' has no attribute 'lynx'
>>> webbrowser._browsers
{'macosx': [None, <webbrowser.MacOSXOSAScript object at 0x10df412e8>], 'chrome': [None, <webbrowser.MacOSXOSAScript object at 0x10df41358>], 'firefox': [None, <webbrowser.MacOSXOSAScript object at 0x10df485c0>], 'safari': [None, <webbrowser.MacOSXOSAScript object at 0x10df48b70>], 'lynx': [None, <webbrowser.GenericBrowser object at 0x10e014198>]}
>>> webbrowser._browsers['lynx'].open('http://google.com')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'open'
>>> webbrowser._browsers['lynx'][1].open('http://google.com') # This works
True
``` |
|
Date |
User |
Action |
Args |
2018-07-26 16:44:44 | ograycode | set | recipients:
+ ograycode, ronaldoussoren, ned.deily |
2018-07-26 16:44:44 | ograycode | set | messageid: <1532623484.23.0.56676864532.issue34238@psf.upfronthosting.co.za> |
2018-07-26 16:44:44 | ograycode | link | issue34238 messages |
2018-07-26 16:44:44 | ograycode | create | |
|