[New-bugs-announce] [issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

Simon Conseil report at bugs.python.org
Sat Aug 29 12:01:40 CEST 2015


New submission from Simon Conseil:

Hi,

There is an issue in the webbrowser module for Mac OS when the BROWSER environment variable is set:

Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Jedi is not installed, falling back to readline
Python shell history: /Users/simon/.pythonhistory
>>> import webbrowser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/webbrowser.py", line 669, in <module>
    cmd = _synthesize(cmdline, -1)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/webbrowser.py", line 94, in _synthesize
    if controller and name.lower() == controller.basename:
AttributeError: 'MacOSXOSAScript' object has no attribute 'basename'

If I unset BROWSER then it works fine. The issue is that the MacOSXOSAScript class overrides BaseBrowser's init without redifining the basename attribute. So a simple fix is to remove the __init__ from MacOSXOSAScript (and I guess the same applies to the MacOSX class). The same issue applies to python 3.4

----------
components: Library (Lib), Macintosh
files: webbrowser.patch
keywords: patch
messages: 249316
nosy: ned.deily, ronaldoussoren, sconseil
priority: normal
severity: normal
status: open
title: webbrowser broken on Mac OS X when using the BROWSER variable
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file40290/webbrowser.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24955>
_______________________________________


More information about the New-bugs-announce mailing list