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 <rep...@bugs.python.org>
<http://bugs.python.org/issue24955>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to